1 | <?php |
||
12 | class MediaLibraryServiceProvider extends ServiceProvider |
||
13 | { |
||
14 | /** |
||
15 | * Bootstrap the application events. |
||
16 | */ |
||
17 | public function boot() |
||
18 | { |
||
19 | $this->publishes([ |
||
20 | __DIR__.'/../config/medialibrary.php' => config_path('medialibrary.php'), |
||
21 | ], 'config'); |
||
22 | |||
23 | $this->publishes([ |
||
24 | __DIR__.'/../database/migrations/create_media_table.php.stub' => database_path('migrations/'.date('Y_m_d_His', time()).'_create_media_table.php'), |
||
25 | ], 'migrations'); |
||
26 | |||
27 | $mediaClass = config('medialibrary.media_model'); |
||
28 | |||
29 | $mediaClass::observe(new MediaObserver()); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * Register the service provider. |
||
34 | */ |
||
35 | public function register() |
||
53 | } |
||
54 |