1 | <?php |
||
10 | class ElfinderServiceProvider extends ServiceProvider |
||
11 | { |
||
12 | /** |
||
13 | * namespace. |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $namespace = 'Recca0120\Elfinder\Http\Controllers'; |
||
18 | |||
19 | /** |
||
20 | * handle routes. |
||
21 | * |
||
22 | * @param \Illuminate\Routing\Router $router |
||
23 | */ |
||
24 | public function boot(Router $router) |
||
34 | |||
35 | /** |
||
36 | * Register any application services. |
||
37 | */ |
||
38 | 1 | public function register() |
|
39 | { |
||
40 | 1 | $this->mergeConfigFrom(__DIR__.'/../config/elfinder.php', 'elfinder'); |
|
41 | |||
42 | $this->app->singleton('elfinder.options', function ($app) { |
||
43 | 1 | return new Options( |
|
44 | 1 | $app['request'], |
|
45 | 1 | $app['files'], |
|
46 | 1 | $app['url'], |
|
47 | 1 | new LaravelSession($app['session']), |
|
48 | 1 | $app['config']['elfinder'] |
|
49 | 1 | ); |
|
50 | 1 | }); |
|
51 | |||
52 | $this->app->singleton('elfinder', function ($app) { |
||
53 | 1 | return new elFinder((array) $app['elfinder.options']); |
|
54 | 1 | }); |
|
55 | |||
56 | $this->app->singleton(Connector::class, function ($app) { |
||
57 | 1 | return new Connector($app['elfinder']); |
|
58 | 1 | }); |
|
59 | 1 | } |
|
60 | |||
61 | /** |
||
62 | * register routes. |
||
63 | * |
||
64 | * @param \Illuminate\Routing\Router $router |
||
65 | * @param array $config |
||
66 | */ |
||
67 | protected function handleRoutes(Router $router, $config) |
||
77 | |||
78 | /** |
||
79 | * handle publishes. |
||
80 | * |
||
81 | * @return void |
||
82 | */ |
||
83 | protected function handlePublishes() |
||
97 | } |
||
98 |