Laravel Configuration (No such file directory ~/.homestead/Homestead.yaml) - php

Hello, I wanted to try creating a Laravel Application and I am really new to this.
I tried all the best I can to analyze and implement the solutions of other people but to no success.
So I have followed the methods in configuring the Laravel App.
The ssh key has also been created in the homekey file as seen from the Homestead.yaml file, I edited it.
But when I try to do 'vagrant up'.
This error message begin to show.
It seems looking for the directory of .homestead but even I can't find it.
I don't know what step am I overlooking.

Related

Livewire views not found after deployment

After deployment to Forge, my Laravel Livewire site is throwing out a server error. I am using Digital Ocean as well. In the Forge site logs it says that my livewire view can't be found. The app works perfectly on local. Any ideas what to do?
I have attempted these commands
Here is the site logs pt.1
and pt.2
I have followed the path of my files and I can confirm there aren't any spelling errors, and to my knowledge, the names of my files are not an issue, since I have followed conventional php artisan make:livewire folder.FooBar as the documentation states.
One thing I might think was that I changed the names and rearranged the folders maybe 20 commits before my deployment commit, but I can't see that affecting anything. Please if you have any suggestions I'd love the help
Here is my github Repository
It's a matter of case-sensitivity.
In your linked repository, the folder for your resources/views/livewire/home/home- index.blade.php, is actually called resources/views/livewire/Home/home-index.blade.php, which is a different animal altogether. Notice the capital H in your Home folder. The same thing applies to the other folders within your Livewire resources folder.
Having the folders with capital letters can work in some environments, and not work in others - for different reasons, and to avoid it, all your folders within your resources directory should always be named with lower-case.
For future reference, this is how I create Livewire components with artisan, and then don't touch the names without using the appropriate renaming command.
php artisan make:livewire Home/HomeIndex
If you want to use the kebab-case notation, note that it's all lowercase.
php artisan make:livewire home.home-index
As #Qirel pointed out, my folder names were not correct. I didn't catch the error because my local file tree was all lowercase [![lowercase][1]][1]
But my master branch had not caught that change long ago when I changed it
[![capital][2]][2]
Thank you for the help guys
[1]: https://i.stack.imgur.com/1rGns.png
[2]: https://i.stack.imgur.com/fQsex.png

How to work on a website which is selected as down mode?

I use Laravel framework and as you know there is a something named Maintenance Mode. That's perfect for debugging the online version of your website. I mean, you can simply deactivate your website to open by this command:
php artisan down
Also you can make it alive again by this one:
php artisan up
Ok all fine .. My question is, how can I see the result of debugging on my website in this case? I mean, when my website is down for my website's user, I need to load it and do some tests on it .. but sadly it is also down for me.
Anyway, I'm looking for an approach to shut down my website for everybody except myself. Any idea?
Create a local development environment, preferably with something like Homestead or Valet.
Basic rule of thumb on the internet: if you can see it, someone else can.
The local environment also gives you the benefit that should you mess something up, no end user will experience that.

redbeanPHP database connect doesn´t work in phpUnit bootstrap

i am using redbeanPHP since two years.
On my new project i wan´t to implement unit-tests from the beginning.
I installed phpUnit and without the database connection all works fine. I now wan´t to test my classes with database intigration. I know this is not a unit-test anymore. But i thing it will help me a lot to auto test the functionality from the implementation.
I call R::setup("mysql:host=localhost;dbname=ufm","root","root"); in my setup file which i declared as bootstrap file for phpUnit.
If i now run my tests i get:
PDOException: Could not connect to database (ufm).
phar:///Applications/MAMP/htdocs/ufm/core/plugins/rb.phar/RedBeanPHP/Driver/RPDO.php:280
phar:///Applications/MAMP/htdocs/ufm/core/plugins/rb.phar/RedBeanPHP/Driver/RPDO.php:126
phar:///Applications/MAMP/htdocs/ufm/core/plugins/rb.phar/RedBeanPHP/Driver/RPDO.php:289
phar:///Applications/MAMP/htdocs/ufm/core/plugins/rb.phar/RedBeanPHP/Adapter/DBAdapter.php:79
phar:///Applications/MAMP/htdocs/ufm/core/plugins/rb.phar/RedBeanPHP/QueryWriter/AQueryWriter.php:576
phar:///Applications/MAMP/htdocs/ufm/core/plugins/rb.phar/RedBeanPHP/OODB.php:893
phar:///Applications/MAMP/htdocs/ufm/core/plugins/rb.phar/RedBeanPHP/Facade.php:463
/Applications/MAMP/htdocs/ufm/tests/TurnierTest.php:14
The strange thing is that i am using the same setup file in my normal application. There all works fine.
Has phpUnit or redbeanPHP any limitations for database connection in the bootstrap file? I searched for two days now but i can´t find any documentation about this. I only found a blogpost on google groups where some guy successfully makes the exact same thing.
Thanks for your help.
Best regards,schw4ndi
Try this:
R::setup("mysql:host=localhost;dbname=ufm;port=3306","root","root");
I added port number there see if that helps.
If you need a working Test Unit + Redbean example, you can try skully framework here: http://github.com/triodigital/skully-project
Setting up
Clone this project to your server.
Copy config/config.unique.php.original to config/config.unique.php and update the database information there.
Update baseUrl config in config/config.common.php.
Copy .htaccess.original to .htaccess and update the first line of that file.
Update the project by running './composer.phar install'.
I stumbled accros the same error again.
Just change the localhost to 127.0.0.1 and it works fine! Maybe it helps someone in the future.
R::setup("mysql:host=127.0.0.1;dbname=ufm","root","root");

Symfony2 console doesn't interact

When I was creating projects in Symfony2 on Windows there were no problems, but now (linux) I got something like this:
when I want to generate bundle without any parameters I get
[RuntimeException]
The "namespace" option must be provided.
When I type in the namespace I get:
[RuntimeException]
The "dir" option must be provided.
I can create bundle only if I give all the necessary arguments at the beginning and I'm kinda lazy person and it's quite annoying for me that console doesn't ask about namespace or anything. Is there any chance to repair this?:P
EDIT: actually this happens whenever I try to run function which requires arguments.
I've tried too to create a bundle with Netbeans or Eclipse but i have encountered the same problem.
The unique solution is to create your bundle with the Terminal.
All the process will run normally, and you'll only to answer the questions for finish your creation.
I'll come back to you if i've other solutions.
Cordially.
your problem doesn't come from netbeans, I use phpstorm and I had the same problem.
later I found out that the problem comes from symfony to solve it go to your project folder for me it was like:
/opt/lampp/htdocs/MyProject/vendor/symfony/symfony/src/Symfony/Component/console and open file Application.php in a text editor
search for
$input->setInteractive(false);
then comment it like this :
//$input->setInteractive(false);
it should perfectly work now !

Importing and accessing existing PHP application into XAMPP

I am new to PHP (have been a Java guy all my years :-) but understand the basics of it. For an existing application on which I need to fix some bugs, I need to import it into XAMPP.
I tried putting all the application folders (and files) into the htdocs folder of XAMPP. However, that does not work. The server does list the new project when I navigate to "http://localhost" but when I click on my project (that I copied), the index.php page fails to come up. It simply says page not found.
I would like to know a couple of things as listed below...
1) Is there something wrong I am doing for the project to be hosted on XAMPP?
2) One peculiar thing that I noticed was that when the application browses to http://localhost/MyProject/index.php , it gets redirected to http://www.localhost/index.php . Is there a URLRewriter (or kind) which is doing this? If yes, where I can find the same within my project?
3) How can I identify the framework that the existing code is using? I can see M-V-C named class.php files
Any pointers would be much helpful for me to start debugging and learning PHP.
Thanks!!

Categories