php 清除所有Laravel缓存并再次缓存。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 清除所有Laravel缓存并再次缓存。相关的知识,希望对你有一定的参考价值。

<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;

class ReloadCacheCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'reload:cache';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Reload caches.';

    /**
     * Create a new command instance.
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $this->call('view:clear');
        $this->call('view:cache');
        $this->call('route:clear');
        // $this->call('route:cache'); // use this if you don't have any closure based route
        $this->call('optimize:clear');
        $this->call('config:cache');
        $this->info('Successfully reload caches.');
    }
}

以上是关于php 清除所有Laravel缓存并再次缓存。的主要内容,如果未能解决你的问题,请参考以下文章