Skip to content

Commit

Permalink
Always publish migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVanderbist committed Oct 16, 2018
1 parent acec8ad commit 491d3f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,16 @@ You can install the package via composer:
composer require spatie/laravel-database-mail-templates
```

If you want to use the [default `MailTemplate` model](#default-mailtemplate-model), all that's left to do is run `php artisan migrate` to create the `mail_templates` table. There's no need to publish the migration.

If you plan on creating a [custom `MailTemplate` model](#custom-mailtemplate-model) continue by publishing the migration:
Publish and run the database migrations:

```bash
php artisan vendor:publish --provider="Spatie\MailTemplates\MailTemplatesServiceProvider" --tag="migrations"
```

If you want to use the [default `MailTemplate` model](#default-mailtemplate-model), all that's left to do is run `php artisan migrate` to create the `mail_templates` table.

If you plan on creating a [custom `MailTemplate` model](#custom-mailtemplate-model) continue by modifying the migration and creating your custom model before running `php artisan migrate`.

## Usage

After installing the package and running the migrations you'll have a new table in your database called `mail_templates`. This table will be used by the `MailTemplate` model.
Expand Down
2 changes: 0 additions & 2 deletions src/MailTemplatesServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ class MailTemplatesServiceProvider extends ServiceProvider
public function boot()
{
if ($this->app->runningInConsole()) {
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');

$this->publishes([
__DIR__.'/../database/migrations/' => database_path('migrations'),
], 'migrations');
Expand Down

0 comments on commit 491d3f6

Please sign in to comment.