-
-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathFilesystemServiceProvider.php
63 lines (53 loc) · 1.45 KB
/
FilesystemServiceProvider.php
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
declare(strict_types=1);
/**
* This file is part of Laravel Zero.
*
* (c) Nuno Maduro <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace LaravelZero\Framework\Providers\Filesystem;
use Illuminate\Contracts\Filesystem\Filesystem;
use Illuminate\Filesystem\FilesystemServiceProvider as BaseServiceProvider;
/**
* @internal
*/
final class FilesystemServiceProvider extends BaseServiceProvider
{
/**
* {@inheritdoc}
*/
public function register(): void
{
parent::register();
$this->app->alias('filesystem.disk', Filesystem::class);
$config = $this->app->make('config');
if ($config->get('filesystems.default') === null) {
$config->set('filesystems', $this->getDefaultConfig());
}
}
/**
* Returns the default application filesystems config.
*
* We it simple we use the `local` driver.
*/
protected function getDefaultConfig(): array
{
return [
'default' => 'local',
'disks' => [
'local' => [
'driver' => 'local',
'root' => $this->app->storagePath('app'),
],
],
];
}
/** Laravel Zero doesn't support serving files. */
protected function shouldServeFiles(array $config)
{
return false;
}
}