'How do we Clear Controller And Model cache in Laravel

I have very simple application in Laravel 5.5.

My Route : Route::resource('books', 'BookController');
My Controller is app/http/Controllers/BookController.php
My Model is app/Book.php

I have similar other modules as well.

INTERESTING PART IS :

My Book controller changes are not being reflected in browser.

I thought of clearing the cache so cleared all caches.

1. Cleared Application Cache > php artisan cache:clear
2. Cleared Route Cache > php artisan route:clear
3. Cleared Configuration Cache > php artisan config:clear 
4. Cleared Compiled Views Cache > php artisan view:clear 

I was not sure which cache was causing the issue so I cleared all. Still my changes are not being reflected in the browser, but when I change the view files, the changes are being reflected.

Any Suggestion please?????



Solution 1:[1]

Finally I guess I have found the solutions. All the files are being cached in this location

/home/project/public_html/vendor/composer/autoload_classmap.php
where project = project name

So if we change the file name, then we need to run the following commands.

php artisan clear-compiled 
composer dump-autoload
php artisan optimize

Since the above bug ruins my past 2 days, so I guess its worth sharing for someone having the same issue or problem.

**Please correct me if above solution can be optimized.

Solution 2:[2]

Use this for cache clear in your laravel project.

php artisan cache: clear. php artisan config: clear. php artisan cache: clear

Solution 3:[3]

If in your model use trait Cachable, but you want to test the changed data on last record you called before. Let comment line code "use Cachable".

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Saroj Shrestha
Solution 2 Zabbir Hossain
Solution 3 MrTo-Kane