How to run command php artisan serve without change to the proect directory?
I try to run this command but nothing happen
php /home/john/Documents/project/ artisan serve --port=1111
I want to insert this command to alisases at bash aliases so i don't need to insert the port anymore.
Please help me, how to run artisan with specified directory?
Try to remove space:
php /home/john/Documents/project/artisan serve --port=1111
Related
Is there a way to run terminal commands simultaneously
Like
php artisan serve
And
npm run dev (for laravel vite)
Run it in a comment or terminal with a shortcut
Yes. There is a creative way
You should define a variable in your command line
İf you're using linux run this command:
export part="php $PWD/artisan serve"
Note:part is variable name. Name it whatever you want (part stands for php artisan)
Note:by running this command the variable will accessible just in that CMD window. That means this way is a temporary way and if you want to access it all the time you need to add this command to your .bash or .profile file
I use Laravel 6.2 with valet and PHP 7.3.12
The problem is I want to change DB_DATABASE=laravel to DB_DATABASE=something_else in .env file
but it doesn't reload the new .env value at all
I have already tried this command:
php artisan config:clear
php artisan config:cache
but it still doesn't change at all.
I even try to add a new key to .env file and query it in Tinker and the new key doesn't add as well.
After completion of .env edit, You can clear the configuration cache with the following artisan command: php artisan config:cache
Use php artisan key:generate it will generate the new key to your .env file
NOTE: If there is still error then you do not need your restart computer just try this:
If you are using the PHP's default web server (eg. php artisan serve) you need to restart your server
OR
If you have used XAMPP then restart your Apache server
I just restart my computer at first it doesn't work then I did
php artisan config:cache and it works now.
whenever you want to change content .env file
run php artisan cache:clear command to get newly added values
Restarting you computer has nothing to do with it.
If you are working on a local environment then please stop your development server by pressing ctrl+c and then restart the application by running php artisan serve.
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.
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
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.