Skip to content

Commit 510e222

Browse files
authored
Merge pull request #54 from Mombuyish/master
修正重覆發佈 migration
2 parents bf9ce8c + 0c1af84 commit 510e222

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

src/FollowServiceProvider.php

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,20 @@ class FollowServiceProvider extends ServiceProvider
2020
*/
2121
public function boot()
2222
{
23-
$root = dirname(__DIR__);
23+
$this->publishes([
24+
realpath(__DIR__.'/../config/follow.php') => config_path('follow.php'),
25+
], 'config');
2426

25-
if (!file_exists(config_path('follow.php'))) {
26-
$this->publishes([
27-
$root.'/config/follow.php' => config_path('follow.php'),
28-
], 'config');
29-
}
30-
31-
if (!class_exists('CreateLaravelFollowTables')) {
32-
$datePrefix = date('Y_m_d_His');
33-
$this->publishes([
34-
$root.'/database/migrations/create_laravel_follow_tables.php' => database_path("/migrations/{$datePrefix}_create_laravel_follow_tables.php"),
35-
], 'migrations');
36-
}
27+
$this->publishes([
28+
realpath(__DIR__.'/../database/migrations') => database_path('migrations'),
29+
], 'migrations');
3730
}
3831

3932
/**
4033
* Register the service provider.
4134
*/
4235
public function register()
4336
{
44-
$this->mergeConfigFrom(dirname(__DIR__).'/config/follow.php', 'follow');
37+
$this->mergeConfigFrom(realpath(__DIR__.'/../config/follow.php'), 'follow');
4538
}
4639
}

0 commit comments

Comments
 (0)