Skip to content

Commit ec58f17

Browse files
committed
The migration is published optionally, not always
1 parent 48c9adb commit ec58f17

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ You can modify the path used on run-time using `Setting::setPath($path)`.
5757

5858
#### Using Migration File
5959

60-
If you use the database store you need to run `php artisan migrate --package=anlutro/l4-settings` (Laravel 4.x) or `php artisan migrate --path=vendor/anlutro/l4-settings/src/migrations` (Laravel 5.x) to generate the table.
60+
If you use the database store you need to run `php artisan migrate --package=anlutro/l4-settings` (Laravel 4.x) or `php artisan vendor:publish --provider="anlutro/l4-settings" --tag="migrations" && php artisan migrate` (Laravel 5.x) to generate the table.
6161

6262
#### Example
6363

src/ServiceProvider.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,12 @@ public function register()
5858
*/
5959
public function boot()
6060
{
61-
if (version_compare(Application::VERSION, '5.3', '>=')) {
62-
$this->loadMigrationsFrom(__DIR__.'/migrations');
63-
$this->publishes([
64-
__DIR__.'/config/config.php' => config_path('settings.php')
65-
], 'config');
66-
} else if (version_compare(Application::VERSION, '5.0', '>=')) {
61+
if (version_compare(Application::VERSION, '5.0', '>=')) {
6762
$this->publishes([
6863
__DIR__.'/config/config.php' => config_path('settings.php')
6964
], 'config');
7065
$this->publishes([
71-
__DIR__.'/migrations' => database_path('migrations')
66+
__DIR__.'/migrations/2015_08_25_172600_create_settings_table.php' => database_path('migrations/'.date('Y_m_d_His').'_create_settings_table.php')
7267
], 'migrations');
7368
} else {
7469
$this->app['config']->package(

0 commit comments

Comments
 (0)