Laravel completely ignoring my config file - laravel

So, I'm trying to use Intervention Image with the Imagick driver.
I've done php artisan vendor:publish, and selected Intervention, and now config/image.php exists. I've changed 'driver' => 'gd' to 'driver' => 'imagick', but nothing at all happens.
I then tried php artisan config:cache, same thing.
Then composer dump-autoload, then php artisan cache:clear and any other combinations of the above.
I can put literally anything in this file, fill the array with invalid syntax, junk etc, and it's completely ignored.
Is there something I'm missing? I've tried everything I'm aware of.

Please delete cache folder from bootstrap folder and create new empty cache folder in bootstrap folder after run below command
php artisan config:cache
php artisan cache:clear

Please try with:
php artisan config:clear
The config:clear command is used to remove the configuration cache file created by the config:cache command. By default this command will delete the bootstrap/cache/config.php file.

Related

file_put_contents(C:\xampp\htdocs\instant\storage\framework/sessions/FF): failed to open stream: No such file or directory

I was trying to upload this instance on Amazon elasticBeanstalk, but it doesn't seem to work.
I have tried using ssh to access the files to no avail.
i did php artisan config:cache and composer dump-autoload before uploading.
Any help is appreciated.
Go to directory laravel/bootstrap/cache and delete config.php file.
Open terminal in your project directory and run this cmd:
php artisan config:clear
How did I solve this issue? After running those commands and not getting the solution.
composer dump-autoload
composer install
php artisan cache:clear
php artisan config:clear
php artisan optimize
php artisan clear-compiled
The issue was simple. In my case under storage/framework there is sessions folder is missing so I created the directory and run the command again. And issue solved.
**Note: In some cases if your run php artisan cache:clear and php artisan config:clear. Your issue will be solved.
Hope this thread will solve your issue.
Happy Coding :)
Can try using php artisan optimize. This will clear everything that cache your projects.
Let me know if this help you guys. Thanks!
run php artisan vendor:publish
Asking Which provider or tag's files would you like to publish?:
Type 0
Then run php artisan serve
This command work in my case: php artisan config: clear
It worked for me when i changed all paths in C:\xampp\htdocs...\bootstrap\cache\config.php

There is no existing directory at /storage/logs and its not buildable: Permission denied

I have a problem with my Laravel deployment on a OVH web server.
After made
composer update
php artisan cache:clear
php artisan route:clear
php artisan dump-autoload
I have this answer:
There is no existing directory at /storage/logs and its not buildable: Permission denied
I put all the files on 777 chmod but I have always this answer.
Please try the following commands
php artisan route:clear
php artisan config:clear
php artisan cache:clear
Note: In case you are a Homestead & VirtualBox user, please be sure that your VirtualBox is up to date.
It helped in this thread at laracasts
Clear the cache and config, then deploy to the live server.
If you've already uploaded to the live server, then you have to follow these steps:
Delete bootstrap/cache/config.php
Delete all log files in storage/logs.
You don't need to add any permission on the storage file.
The main problem here is in the compiled file, and due to which laravel try to show an error.
By default in laravel, storage file not having permission to show in the console (error
shows from the error.log file).
So the thing you need to fix is to fix compile file. which can be done thought this single command
Use this
php artisan optimize:clear
This command will clear all your cache
Compiled views
Application cache
Route cache
Configuration cache
After changing local conf i got the same error over and over,
try this, probably will help.
rm bootstrap/cache/config.php
and then
php artisan cache:clear
depending on your scenario, reloading auto-loader file can solve your issue, for that use :
composer dump-autoload
or sometimes just try :
composer install
this do the two the commands listed above.
go to your vagrant
then run
vagrant ssh
php artisan config:cache
Run the following command if you can access your server terminal
php artisan route:clear && php artisan cache:clear && php artisan config:clear && php artisan config:cache
If you are on shared hosting and cant access the terminal go to your web route file in routes/web.php and make a temporary link such as shown:
Route::get('reset', function (){
Artisan::call('route:clear');
Artisan::call('cache:clear');
Artisan::call('config:clear');
Artisan::call('config:cache');
});
Then go to http://your-domain/reset to execute the commands. there after you can now access your website as normal
If you are using homestead (vagrant) in Laravel then follow the steps #Farid shahidi provided
vagrant ssh
cd /home/vagrant/code <-- your file usually resides here; see your Homestead.yaml configuration
php artisan config:cache
You Have to try artisan command in this way
php artisan cache: clear
php artisan config:cache
php artisan cache: clear
This one-line command solves my issue:
php artisan config:cache
Delete bootstrap/cache/config.php from your laravel deployment on the server.
Please run the below commands:
php artisan route:clear
php artisan config:clear
php artisan cache:clear
This one worked for me in case your project is located within /var/www/html/
sudo chmod -Rf 0777 /var/www/html/{project-name}/bootstrap/cache
sudo chmod -Rf 0777 /var/www/html/{project-name}/storage
You need to run this command from the terminal.
php artisan config:clear
php artisan config:cache
I got the same issue, I change the permissions of the folders inside the the storage folder.
chmod 777 <folder_name>
I'm not sure about this security wise. but this resolve my problem.
I change my file settings to 755 also work for me.
try this
remove your "vendor" folder
Run "composer install" or "composer install --ignore-platform-reqs" on your cmd or terminal
php artisan config:cache
php artisan config:clear
php artisan cache:clear
php artisan route:cache
php artisan view:clear
php artisan config:cache
if you are using linux:
service apache2 restart (just in case)
if you using xammp:
just restart your xammp
For those of you using sail, do:
sail artisan optimize:clear

Does not clear cache in Laravel

I have view file, I make some changes in there but I don't look changes in browser.
I put next command (it doesn't help me):
php artisan cache:clear
php artisan view:clear
php artisan route:clear
How to fix this problem?
In my case I just rename file and it's help me. For example,
edit.blade.php->editt.blade.php->edit.blade.php
After that I can do any edits and it's work. But I don't understand why it happens.

There are no commands defined in the "passport" namespace. When installing API Authentication In laravel

I am getting below error when i run
php artisan passport:install
[Symfony\Component\Console\Exception\CommandNotFoundException]
There are no commands defined in the "passport" namespace.
For installing laravel passport make sure you add this line to config/app.php in the providers array (package service providers section):
Laravel\Passport\PassportServiceProvider::class,
Then install the package and migrate the database
composer require laravel/passport
php artisan migrate
php artisan passport:install
Clearing out the cache is generally helpful first step when commands are not working, especially when you update anything in the config folder on .env files.
php artisan config:clear
php artisan config:cache
Config clear removes the configuration cache file. Config cache creates a new configuration cache file with the current settings. Config cache enables faster load times for your apps!
I got solution. After running following two commands every thing work fine.
run php artisan cache:clear
run php artisan config:cach
I was searching for a solution for this and I found simple one that worked for me:
Add these lines to $commands array in app/Console/Kernel.php
\Laravel\Passport\Console\InstallCommand::class,
\Laravel\Passport\Console\KeysCommand::class,
\Laravel\Passport\Console\ClientCommand::class,
Try running composer require laravel/passport "~9.0" before running php artisan passport:install
Just follow these steps:
composer require laravel/passport.
Once the installation finishes, add the following provider in the config/app.php file: Laravel\Passport\PassportServiceProvider::class,
php artisan migrate
php artisan passport:install
Here Is the solution of install Laravel passport with mongodb:
Just replace the Illuminate\Database\Eloquent\Model; with Jenssegers\Mongodb\Eloquent\Model in below files:
..\vendor\laravel\passport\src\Token.php,
..\vendor\laravel\passport\src\AuthCode.php
..\vendor\laravel\passport\src\Client.php
..\vendor\laravel\passport\src\PersonalAccessClient.php
and protected $table= "Table_name" variable with protected $collection="Table_name"

Reload .env constants in Laravel 5.2

I just changed a constant inside my .env file. The new value is shown up correctly with php-cli (via tinker), but not in my web app (php-fpm).
So far I've tried everything as suggested:
sudo service nginx restart
sudo service php7.0-fpm restart
sudo service php7.0-fpm reload
.
php artisan config:cache
This will generate a cache config file in bootstrap/cache/config.php
php artisan config:clear
This will remove cache config file in bootstrap/cache/config.php
php artisan cache:clear
What exactly does does ? What type of cache does it clear?
php artisan clear-compiled
This clear compile classes
composer dump-autoload
This will generate/update composer autoload file.
I have some .env variables that are not part of any config file. So it is useless for me to run any of the artisan commands.
None of the above php artisan commands don't deal directly with $_ENV.
Seems that $_ENV is stored somewhere in the server and laravel cannot update it once properties are populated.
The only solution I've found is restarting the server.
I'm running a Laravel Forge instance.
If it is cached and you need to reload it you can simply use:
php artisan config:clear
This will pull in any changes that you have since made.
Try to delete the config on file on: Bootstrap/cache/config.php
AS well you can try: php artisan config:cache or php artisan cache:clear

Resources