Skip to content

Commit

Permalink
Merge pull request #54 from Mombuyish/master
Browse files Browse the repository at this point in the history
修正重覆發佈 migration
  • Loading branch information
overtrue authored Jun 29, 2018
2 parents bf9ce8c + 0c1af84 commit 510e222
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions src/FollowServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,20 @@ class FollowServiceProvider extends ServiceProvider
*/
public function boot()
{
$root = dirname(__DIR__);
$this->publishes([
realpath(__DIR__.'/../config/follow.php') => config_path('follow.php'),
], 'config');

if (!file_exists(config_path('follow.php'))) {
$this->publishes([
$root.'/config/follow.php' => config_path('follow.php'),
], 'config');
}

if (!class_exists('CreateLaravelFollowTables')) {
$datePrefix = date('Y_m_d_His');
$this->publishes([
$root.'/database/migrations/create_laravel_follow_tables.php' => database_path("/migrations/{$datePrefix}_create_laravel_follow_tables.php"),
], 'migrations');
}
$this->publishes([
realpath(__DIR__.'/../database/migrations') => database_path('migrations'),
], 'migrations');
}

/**
* Register the service provider.
*/
public function register()
{
$this->mergeConfigFrom(dirname(__DIR__).'/config/follow.php', 'follow');
$this->mergeConfigFrom(realpath(__DIR__.'/../config/follow.php'), 'follow');
}
}

0 comments on commit 510e222

Please sign in to comment.