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 Illuminate\Filesystem\Filesystem;
7
use Symfony\Component\Console\Attribute\AsCommand;
8
 
9
#[AsCommand(name: 'route:clear')]
10
class RouteClearCommand extends Command
11
{
12
    /**
13
     * The console command name.
14
     *
15
     * @var string
16
     */
17
    protected $name = 'route:clear';
18
 
19
    /**
20
     * The name of the console command.
21
     *
22
     * This name is used to identify the command during lazy loading.
23
     *
24
     * @var string|null
25
     *
26
     * @deprecated
27
     */
28
    protected static $defaultName = 'route:clear';
29
 
30
    /**
31
     * The console command description.
32
     *
33
     * @var string
34
     */
35
    protected $description = 'Remove the route cache file';
36
 
37
    /**
38
     * The filesystem instance.
39
     *
40
     * @var \Illuminate\Filesystem\Filesystem
41
     */
42
    protected $files;
43
 
44
    /**
45
     * Create a new route clear command instance.
46
     *
47
     * @param  \Illuminate\Filesystem\Filesystem  $files
48
     * @return void
49
     */
50
    public function __construct(Filesystem $files)
51
    {
52
        parent::__construct();
53
 
54
        $this->files = $files;
55
    }
56
 
57
    /**
58
     * Execute the console command.
59
     *
60
     * @return void
61
     */
62
    public function handle()
63
    {
64
        $this->files->delete($this->laravel->getCachedRoutesPath());
65
 
66
        $this->components->info('Route cache cleared successfully.');
67
    }
68
}