forked from UniSharp/laravel-filemanager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLaravelFilemanagerServiceProvider.php
60 lines (49 loc) · 1.59 KB
/
LaravelFilemanagerServiceProvider.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
<?php
namespace UniSharp\LaravelFilemanager;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
/**
* Class LaravelFilemanagerServiceProvider.
*/
class LaravelFilemanagerServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
$this->loadTranslationsFrom(__DIR__.'/lang', 'laravel-filemanager');
$this->loadViewsFrom(__DIR__.'/views', 'laravel-filemanager');
$this->publishes([
__DIR__ . '/config/lfm.php' => base_path('config/lfm.php'),
], 'lfm_config');
$this->publishes([
__DIR__.'/../public' => public_path('vendor/laravel-filemanager'),
], 'lfm_public');
$this->publishes([
__DIR__.'/views' => base_path('resources/views/vendor/laravel-filemanager'),
], 'lfm_view');
$this->publishes([
__DIR__.'/Handlers/LfmConfigHandler.php' => base_path('app/Handlers/LfmConfigHandler.php'),
], 'lfm_handler');
if (config('lfm.use_package_routes')) {
Route::group(['prefix' => 'filemanager', 'middleware' => ['web', 'auth']], function () {
\UniSharp\LaravelFilemanager\Lfm::routes();
});
}
}
/**
* Register the application services.
*
* @return void
*/
public function register()
{
$this->mergeConfigFrom(__DIR__ . '/config/lfm.php', 'lfm-config');
$this->app->singleton('laravel-filemanager', function () {
return true;
});
}
}