File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -13,14 +13,24 @@ class BatchNotificationsServiceProvider extends ServiceProvider
13
13
*/
14
14
public function boot ()
15
15
{
16
- if ($ this ->app ->runningInConsole ()) {
17
- $ this ->publishes ([
18
- __DIR__ .'/../migrations/2018_09_04_205640_create_batch_notification_tables.php ' => base_path ('database/migrations ' ),
19
- ]);
16
+ $ time = time ();
20
17
21
- $ this ->commands ([
22
- Console \DispatchBatchNotifications::class
23
- ]);
18
+ if (!class_exists ('CreateBatchNotificationTables ' )) {
19
+ $ migrationFileName = $ this ->getMigrationFilename ('create_batch_notification_tables ' , $ time );
20
+ $ this ->publishes ([
21
+ __DIR__ .'/../migrations/2018_09_04_205640_create_batch_notification_tables.php ' => $ migrationFileName ,
22
+ ], 'migrations ' );
24
23
}
24
+
25
+ $ this ->commands ([
26
+ Console \DispatchBatchNotifications::class
27
+ ]);
28
+ }
29
+
30
+ protected function getMigrationFileName ($ migrationName , $ time )
31
+ {
32
+ $ timestamp = date ('Y_m_d_His ' , $ time );
33
+
34
+ return $ this ->app ->databasePath () . "/migrations/ {$ timestamp }_ {$ migrationName }.php " ;
25
35
}
26
36
}
You can’t perform that action at this time.
0 commit comments