forked from doppar/framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClearRouteCacheCommand.php
More file actions
40 lines (35 loc) · 910 Bytes
/
ClearRouteCacheCommand.php
File metadata and controls
40 lines (35 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
namespace Phaseolies\Console\Commands;
use Phaseolies\Support\Facades\Route;
use Phaseolies\Console\Schedule\Command;
use Phaseolies\Config\Config;
class ClearRouteCacheCommand extends Command
{
/**
* The name of the console command.
*
* @var string
*/
protected $name = 'route:clear';
/**
* The name of the console command.
*
* @var string
*/
protected $description = 'Clear all route cache files from the storage/framework/cache folder';
/**
* Execute the console command.
*
* @return int
*/
public function handle(): int
{
return $this->withTiming(function() {
Route::clearRouteCache();
Config::clearCache();
Config::loadAll();
Config::cacheConfig();
return Command::SUCCESS;
}, 'Route cache has been gracefully cleared.');
}
}