Home  >  Article  >  PHP Framework  >  What is laravel clear cache command

What is laravel clear cache command

藏色散人
藏色散人Original
2021-09-16 11:57:5510724browse

The laravel clear cache commands are: 1. The clear program cache command is "artisan cache:clear"; 2. The clear route cache command is "artisan route:cache"; 3. The clear configuration cache command is "artisan config :cache" and so on.

What is laravel clear cache command

The operating environment of this article: Windows 7 system, Laravel version 5.7, Dell G3 computer

What is the laravel cache clearing command?

Clear laravel cache command

Clear cache in Laravel (terminal)

Log in to the system running the laravel application and open the terminal. Then navigate to the Laravel application code. Here, you can use the following command to clear the cache:

1. Clear application cache

Run the following command to clear the application cache of the Laravel application

$ php artisan cache:clear

2 , Clear route cache

To clear the route cache of your Laravel application, execute the following command from the shell.

$ php artisan route:cache

3. Clear the configuration cache

You can use config:cache to clear the configuration cache of the Laravel application.

$ php artisan config:cache

4. Clear the compiled view files

In addition, you may also need to clear the compiled view files of the Laravel application. To clear compiled view files, run the following command from the terminal.

$ php artisan view:clear

Clear Cache in Laravel (Browser)

Most shared hosting providers do not provide SSH access to the system. In this case, the Laravel cache can be cleared by calling the URL in the browser. Simply place the following code in the routes/web.php file of your Laravel application. Then visit this URL in your browser to clear the cache of your Laravel application.

Route::get('/clear-cache', function() {
    Artisan::call('cache:clear');
    return "Cache is cleared";
});

Recommended: "laravel tutorial"

The above is the detailed content of What is laravel clear cache command. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to install laravelNext article:How to install laravel