Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\Foundation\Console;
4
 
5
use Illuminate\Console\Command;
6
use Symfony\Component\Console\Attribute\AsCommand;
7
 
8
#[AsCommand(name: 'optimize:clear')]
9
class OptimizeClearCommand extends Command
10
{
11
    /**
12
     * The console command name.
13
     *
14
     * @var string
15
     */
16
    protected $name = 'optimize:clear';
17
 
18
    /**
19
     * The name of the console command.
20
     *
21
     * This name is used to identify the command during lazy loading.
22
     *
23
     * @var string|null
24
     *
25
     * @deprecated
26
     */
27
    protected static $defaultName = 'optimize:clear';
28
 
29
    /**
30
     * The console command description.
31
     *
32
     * @var string
33
     */
34
    protected $description = 'Remove the cached bootstrap files';
35
 
36
    /**
37
     * Execute the console command.
38
     *
39
     * @return void
40
     */
41
    public function handle()
42
    {
43
        $this->components->info('Clearing cached bootstrap files.');
44
 
45
        collect([
46
            'events' => fn () => $this->callSilent('event:clear') == 0,
47
            'views' => fn () => $this->callSilent('view:clear') == 0,
48
            'cache' => fn () => $this->callSilent('cache:clear') == 0,
49
            'route' => fn () => $this->callSilent('route:clear') == 0,
50
            'config' => fn () => $this->callSilent('config:clear') == 0,
51
            'compiled' => fn () => $this->callSilent('clear-compiled') == 0,
52
        ])->each(fn ($task, $description) => $this->components->task($description, $task));
53
 
54
        $this->newLine();
55
    }
56
}