Artisan make:controller Doesn't work and no error - php

I'm using Laravel 5.3.0 and it's running on a local server with Manjaro. I access the project folder trough ssh and I'm also using artisan trough SSH.
Everything runs fine, I run the server trough terminal:
php artisan serve --host 192.168.0.10 --port 80
And can acess the project trough browser.
But when I run this command:
php artisan make:controller ContatoController
or
artisan make:controller ContatoController
Nothing happens, it get's stuck, no message error after minutes. No controller is created.
Does anyone know how to solve this?

Here's what happened:
I was running artisan server and after that (on the same terminal) I was running the make:controller command.
The solution was:
1- Open linux terminal, run artisan server;
2- Open another terminal (or split window if you'r using Terminator) and use all commands you want.

Related

Using Terminal in Phpstorm

I create laravel project with PhpStorm. I'm using "Git Bash Here " as terminal.
C:\Users\kadir\www\basit-laravel>php artisan make:controller TestController
'php' is not recognized as an internal or external command,
operable program or batch file.
When I try to use the contents of terminal in PhpStorm, I get this error:
By the way I use vagrant and homestead.
You have two options.
Install your php locally (not recomended, because you will run in another problems with vagrant)
Access your vagrant instance (maybe vagrant ssh in you project folder) and run the php artisan commands
There is something like this as a git bash alternative:
https://cmder.net/
You must show the terminal called git bash or cmder in php storm

Laravel 7.28 not work without php artisan serve command in localhost

Laravel 7.28 not work without php artisan serve command in localhost
I install new Laravel in localhost (/var/www/html/NewLaravel)
When I run http://localhost/NewLaravel/public/ not workling
but when I run with php artisan serve its working on http://127.0.0.1:8000/
Apache2 is working proper and allow access of override for .htaccess
is that new Laravel will only work with php artisan serve ?? or something is missing from my side ?
Step-1:
run apache and sql from xampp server
step-2:
in browser type localhost/NewLaravel and press enter
Step-3:
in list please select public folder it will run

Laravel 5.6 cannot access some .env variables

This frequently happens in my Laravel 5 app where sometimes .env variables cannot be read.
I have the following in my .env file:
STRIPE_SECRET=sk_test_mykey
STRIPE_KEY=pk_test_mykey
After clearing all the cache using all of these commands I still cannot access the STRIPE_SECRET variable:
php artisan config:clear
php artisan cache:clear
php artisan config:cache
composer dump-autoload
I have tried in my controller using env('STRIPE_SECRET') and have also tried in tinker:
Any one know why this happens?
If you are running your server using php artisan serve.
You have to restart your server because built in server cache all the .env variables in its memory.
Just run this: php artisan config:clear
have you restarted your artisan server if not restart it and if you are using a virtual machine like vagrant try to get out of your machine and reload it using
vagrant reload

Where do I run "php artisan make:migration posts" on WIndows?

I am following this tutorial: http://www.findalltogether.com/tutorial/simple-blog-application-in-laravel-5-part-1-setup-database/ to set up a Blog using Laravel.
In the tutorial, it says to make migrations I've to run php artisan make:migration posts. Where do I run this? I tried bash but received the error: Could not open input file: artisan.
I'm on Windows, using xampp - could this be a reason?
Thank you
You have to go in folder where artisan is located (usally root of project) and with CMD or CONSOLE write php artisan make:migration posts
First Navigate to your project directory from command prompt if you have installed the laravel in your project so there should be artisan available you may find by typing "dir" once you find artisan there you should run your respective command. Moreover once you reached to your project directory for testing purpose you may write this line
" php artisan " (without quotes) and press enter you will see all the list of commands available in artisan.
Thanks

How do I remove old artisan command from Kernel in Laravel 5

I have created some Command files into my Laravel Application. Laravel version is 5.2. I set command like: get:email in the Command file. Also call the Command file into Kernel.php. After that I can see the artisan command list by typing the command php artisan list. as like as below:
//output
get:email
And I changed the command title get:email to get-bq:email. When I run the command php artisan get-bq:email -- its working nicely. Also I can see the list by typing the command php artisan list::
//output
get-bq:email
Issue / Problem: Both commands are working. But I won't to work with both of them. I have done the following things:
modified command file as well as command
run composer dump-autoload -o
run composer update
remove vendor and storage folder then run composer update again.
Still the old command is working into my system.
What I want: How May I remove my old commands from my Laravel(5.2) application?
Run these commands:
php artisan cache:clear
php artisan config:clear
These commands will clear app cache and config cache and recreate it.
I've had the same problem recently.
Repoeatedly tried
php artisan cache:clear
php artisan config:clear
and the cached Kernal command wouldn't clear.
In desperation i killed the queue worker terminal and restarted the queue with the command
php artisan queue:work
The issue stopped.

Categories