Skip to content
This repository was archived by the owner on Jul 15, 2021. It is now read-only.

Commit 28551cb

Browse files
authored
Add date generation while publishing migrations
Uses the migration stub and prefixes it with the current timestamp.
1 parent 51b7ef2 commit 28551cb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/LaravelCommentServiceProvider.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ class LaravelCommentServiceProvider extends ServiceProvider
1515
*/
1616
public function boot()
1717
{
18+
$timestamp = date('Y_m_d_His', time());
19+
1820
$this->publishes([
19-
__DIR__.'/../database/migrations/' => database_path('migrations')
21+
__DIR__ . '/../database/migrations/create_comments_table.php.stub' => $this->app->databasePath()
22+
. "/migrations/{$timestamp}_create_comments_table.php",
2023
], 'migrations');
2124
}
2225

0 commit comments

Comments
 (0)