diff --git a/app/Http/Middleware/AppInstallation.php b/app/Http/Middleware/AppInstallation.php index a03596c..cffb8df 100644 --- a/app/Http/Middleware/AppInstallation.php +++ b/app/Http/Middleware/AppInstallation.php @@ -97,8 +97,7 @@ class AppInstallation Artisan::call('cache:clear'); Artisan::call('migrate', ['--force' => true]); - - Artisan::call('db:seed'); + Artisan::call('db:seed', ['--force' => true]); $className = sprintf('DataMigrationV%s', str_replace(['.', '-'], '_', $appVersionNumber)); if (class_exists($className)) diff --git a/app/ModelObservers/AlbumObserver.php b/app/ModelObservers/AlbumObserver.php index 4511f78..8fa126b 100644 --- a/app/ModelObservers/AlbumObserver.php +++ b/app/ModelObservers/AlbumObserver.php @@ -9,14 +9,14 @@ class AlbumObserver public function creating(Album $album) { // Re-generate the alias and path - $album->generateAlias(); - $album->generateUrlPath(); - } + if (is_null($album->url_alias)) + { + $album->generateAlias(); + } - public function updating(Album $album) - { - // Re-generate the alias and path - $album->generateAlias(); - $album->generateUrlPath(); + if (is_null($album->url_path)) + { + $album->generateUrlPath(); + } } } \ No newline at end of file