Skip to content

Commit

Permalink
Publishing groups added and it's called only from console
Browse files Browse the repository at this point in the history
Publish config and migrations are separated in readme
  • Loading branch information
antonkomarev authored and cmgmyr committed Oct 8, 2016
1 parent 36155b3 commit ea45e22
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
8 changes: 6 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ Add the service provider to `config/app.php` under `providers`:
Cmgmyr\Messenger\MessengerServiceProvider::class,
]

Publish Assets
Publish config:

php artisan vendor:publish --provider="Cmgmyr\Messenger\MessengerServiceProvider"
php artisan vendor:publish --provider="Cmgmyr\Messenger\MessengerServiceProvider" --tag="config"

Update config file to reference your User Model:

Expand All @@ -61,6 +61,10 @@ Create a `users` table if you do not have one already. If you need one, simply u
'messages_table' => 'messenger_messages',
'participants_table' => 'messenger_participants',
'threads_table' => 'messenger_threads',

Publish migrations:

php artisan vendor:publish --provider="Cmgmyr\Messenger\MessengerServiceProvider" --tag="migrations"

Migrate your database:

Expand Down
13 changes: 9 additions & 4 deletions src/Cmgmyr/Messenger/MessengerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,15 @@ class MessengerServiceProvider extends ServiceProvider
*/
public function boot()
{
$this->publishes([
base_path('vendor/cmgmyr/messenger/src/config/config.php') => config_path('messenger.php'),
base_path('vendor/cmgmyr/messenger/src/migrations') => base_path('database/migrations'),
]);
if ($this->app->runningInConsole()) {
$this->publishes([
base_path('vendor/cmgmyr/messenger/src/config/config.php') => config_path('messenger.php'),
], 'config');

$this->publishes([
base_path('vendor/cmgmyr/messenger/src/migrations') => base_path('database/migrations'),
], 'migrations');
}

$this->setMessengerModels();
$this->setUserModel();
Expand Down

0 comments on commit ea45e22

Please sign in to comment.