Mail host on .env laravel doesn't change Laravel 5.1 - php

I launched sudo nohup php artisan queue:work --daemon on my server with laravel 5.1, and now I have change MAIL_HOST in my .env, (before I had "mail.mysitem.com" and now I put my intern ip example : 192.168.1.212 ) but it still send mail with old hostname, how I can apply change on .env?
I tried also with:
php artisan queue:restart

Give it a try with:
php artisan config:clear

Related

Laravel ENV not reload

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.

Why I can't change production mode for my laravel project?

I run this command and I found out that I work in production mode:
php artisan env
and after I add to my .env this line:
APP_ENV=development
after I run all this commands
php artisan cache:clear
php artisan view:clear
php artisan config:cache
and always I get production mode
Make sure the value in your app.config uses the env() function to get the value from the .env file.
If not, the recommended value is env('APP_ENV', 'development').

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

Artisan make:controller Doesn't work and no error

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.

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