diff --git a/composer.json b/composer.json index 52677d68..c8732f81 100644 --- a/composer.json +++ b/composer.json @@ -19,9 +19,6 @@ "illuminate/support": "~4.0|~5.0|~5.1" }, "autoload": { - "classmap": [ - "src/migrations" - ], "psr-0": { "Venturecraft\\Revisionable": "src/" } diff --git a/src/migrations/2013_04_09_062329_create_revisions_table.php b/database/migrations/2013_04_09_062329_create_revisions_table.php similarity index 100% rename from src/migrations/2013_04_09_062329_create_revisions_table.php rename to database/migrations/2013_04_09_062329_create_revisions_table.php diff --git a/readme.md b/readme.md index 3e4a944a..a56fe9fc 100644 --- a/readme.md +++ b/readme.md @@ -41,15 +41,18 @@ Run composer update to download the package php composer.phar update ``` -Finally, you'll also need to run migration on the package +After updating composer, add the service provider to the `providers` array in `config/app.php` -``` -php artisan migrate --package=venturecraft/revisionable +```php +Venturecraft\Revisionable\RevisionableServiceProvider::class, ``` -> If you're going to be migrating up and down completely a lot (using `migrate:refresh`), one thing you can do instead is to copy the migration file from the package to your `app/database` folder, and change the classname from `CreateRevisionsTable` to something like `CreateRevisionTable` (without the 's', otherwise you'll get an error saying there's a duplicate class) +Finally, publish the migrations and then migrate. -> `cp vendor/venturecraft/revisionable/src/migrations/2013_04_09_062329_create_revisions_table.php app/database/migrations/` +``` +php artisan vendor:publish --provider="Venturecraft\Revisionable\RevisionableServiceProvider" +php artisan migrate +``` ## Docs diff --git a/src/Venturecraft/Revisionable/RevisionableServiceProvider.php b/src/Venturecraft/Revisionable/RevisionableServiceProvider.php new file mode 100644 index 00000000..0b4a3800 --- /dev/null +++ b/src/Venturecraft/Revisionable/RevisionableServiceProvider.php @@ -0,0 +1,20 @@ +publishes([ + __DIR__ . '/../../../database/migrations/' => database_path('/migrations') + ], 'migrations'); + } + + public function register() + { + + } +}