Ishaan
Ishaan

Reputation: 1340

How to prevent Laravel from caching files?

I am developing a laravel app. I am sending a verification email with the help of inbuilt function Email verification. I had setup mailtrap credentials and successfully receiving emails in my Mailtrap inbox.

But When I changed these credentials to my sendgrid credentials the Laravel is still sending the email to my mailtrap inbox looks like the .env has been cached.

The same happens to my AppServiceProvider file I had made some changes to my email subject but I am still getting the older version of that email.

I have tried clearing cache using

php artisan cache:clear
php artisan route:cache
php artisan config:clear
php artisan view:clear
php artisan clear-compiled

But still, nothing changed Laravel still loading a previous version of files.

I want to load the newer version each time I made any changes to .env or AppServiceProvider.

Upvotes: 1

Views: 395

Answers (2)

Blarn
Blarn

Reputation: 41

Maybe the problem isnt Laravel itself try this: Open php.ini

opcache.revalidate_freq=0
opcache.fast_shutdown=0

Change this lines and restart apache.

Upvotes: 1

Bhushan Patil
Bhushan Patil

Reputation: 88

Hi After clearing cache run

php artisan clear-compiled

php artisan optimize

Upvotes: 0

Related Questions