Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publishing assets improved #165

Merged
merged 1 commit into from
Oct 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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