From 005b56057b38ec01b55b880e30fe4ceb73991074 Mon Sep 17 00:00:00 2001 From: ivoberg Date: Fri, 5 Feb 2021 14:42:37 +0000 Subject: [PATCH] fix: Provider --- src/MediaLibraryServiceProvider.php | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/MediaLibraryServiceProvider.php b/src/MediaLibraryServiceProvider.php index 24ebf8397..bac25369f 100644 --- a/src/MediaLibraryServiceProvider.php +++ b/src/MediaLibraryServiceProvider.php @@ -18,22 +18,6 @@ public function boot() { $this->registerPublishables(); - if (! class_exists('CreateModelHasMediaTable')) { - $this->publishes([ - __DIR__.'/../database/migrations/create_model_has_media_table.php.stub' => database_path('migrations/'.date('Y_m_d_His', time()).'_create_model_has_media_table.php'), - ], 'migrations'); - } - - if (! class_exists('CreateModelHasMediaTable')) { - $this->publishes([ - __DIR__.'/../database/migrations/create_model_has_media_table.php.stub' => database_path('migrations/'.date('Y_m_d_His', time()).'_create_model_has_media_table.php'), - ], 'migrations'); - } - - $this->publishes([ - __DIR__.'/../resources/views' => resource_path('views/vendor/medialibrary'), - ], 'views'); - $mediaClass = config('media-library.media_model'); $mediaClass::observe(new MediaObserver()); @@ -66,6 +50,12 @@ protected function registerPublishables(): void ], 'migrations'); } + if (! class_exists('CreateModelHasMediaTable')) { + $this->publishes([ + __DIR__.'/../database/migrations/create_model_has_media_table.php.stub' => database_path('migrations/'.date('Y_m_d_His', time()).'_create_model_has_media_table.php'), + ], 'migrations'); + } + $this->publishes([ __DIR__.'/../resources/views' => resource_path('views/vendor/media-library'), ], 'views');