Skip to content

Commit

Permalink
feat(exmaple): add exmple asset publish command
Browse files Browse the repository at this point in the history
  • Loading branch information
shailesh-ladumor committed Sep 27, 2024
1 parent 13e3dbf commit 2fc6fd5
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .idea/laravel-messenger.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/phpunit.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/MessagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Controllers;

use App\User;
use App\Models\User;
use Carbon\Carbon;
use Cmgmyr\Messenger\Models\Message;
use Cmgmyr\Messenger\Models\Participant;
Expand Down
6 changes: 6 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ class User extends Authenticatable {
```

## Examples
publish example using following command. This will publish controller and views. you can copy route and put in your routes file.

```
php artisan vendor:publish --provider="Cmgmyr\Messenger\MessengerServiceProvider" --tag="messenger-assets"
```

* [Controller](https://github.com/cmgmyr/laravel-messenger/tree/master/examples/MessagesController.php)
* [Routes](https://github.com/cmgmyr/laravel-messenger/tree/master/examples/routes.php)
* [Views](https://github.com/cmgmyr/laravel-messenger/tree/master/examples/views)
Expand Down
12 changes: 12 additions & 0 deletions src/MessengerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ protected function offerPublishing()
$this->publishes([
__DIR__ . '/../migrations' => base_path('database/migrations'),
], 'migrations');

$this->publishes([
__DIR__ . '/../examples/views/messenger' => resource_path('views/messenger'),
], 'messenger-assets');

$this->publishes([
__DIR__ . '/../examples/views/layouts/master.blade.php' => resource_path('views/layouts/master.blade.php'),
], 'messenger-assets');

$this->publishes([
__DIR__ . '/../examples/MessagesController.php' => app_path('Http/Controllers/MessagesController.php'),
], 'messenger-assets');
}
}

Expand Down

0 comments on commit 2fc6fd5

Please sign in to comment.