Skip to content

Commit 3208642

Browse files
authored
Merge pull request #19 from binafy/add-option-for-publish-middleware
[1.x] Add option to publish middlewares
2 parents 956c95e + 5f73ead commit 3208642

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,24 @@ If you want to publish a config file you can use this command:
5656
php artisan vendor:publish --tag="laravel-user-monitoring-config"
5757
```
5858

59-
If you want to publish migration files you can use this command:
59+
If you want to publish the migrations you can use this command:
6060

6161
```shell
6262
php artisan vendor:publish --tag="laravel-user-monitoring-migrations"
6363
```
6464

65+
If you want to publish the views you can use this command:
66+
67+
```shell
68+
php artisan vendor:publish --tag="laravel-user-monitoring-views"
69+
```
70+
71+
If you want to publish the middlewares you can use this command:
72+
73+
```shell
74+
php artisan vendor:publish --tag="laravel-user-monitoring-middlewares"
75+
```
76+
6577
For convenience, you can use this command to publish config and migration files:
6678

6779
```shell

src/Providers/LaravelUserMonitoringServiceProvider.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public function boot()
4040
$this->publishConfig();
4141
$this->publishMigrations();
4242
$this->publishViews();
43+
$this->publishMiddleware();
4344

4445
$this->viewComposer();
4546
}
@@ -80,6 +81,18 @@ private function publishViews()
8081
], 'laravel-user-monitoring-views');
8182
}
8283

84+
/**
85+
* Publish middleware files.
86+
*
87+
* @return void
88+
*/
89+
private function publishMiddleware()
90+
{
91+
$this->publishes([
92+
__DIR__ . '/../Middlewares' => app_path('Http/Middleware'),
93+
], 'laravel-user-monitoring-middlewares');
94+
}
95+
8396
/**
8497
* View Composer.
8598
*

0 commit comments

Comments
 (0)