diff --git a/README.md b/README.md index 78ab33c..633bd69 100644 --- a/README.md +++ b/README.md @@ -56,12 +56,24 @@ If you want to publish a config file you can use this command: php artisan vendor:publish --tag="laravel-user-monitoring-config" ``` -If you want to publish migration files you can use this command: +If you want to publish the migrations you can use this command: ```shell php artisan vendor:publish --tag="laravel-user-monitoring-migrations" ``` +If you want to publish the views you can use this command: + +```shell +php artisan vendor:publish --tag="laravel-user-monitoring-views" +``` + +If you want to publish the middlewares you can use this command: + +```shell +php artisan vendor:publish --tag="laravel-user-monitoring-middlewares" +``` + For convenience, you can use this command to publish config and migration files: ```shell diff --git a/src/Providers/LaravelUserMonitoringServiceProvider.php b/src/Providers/LaravelUserMonitoringServiceProvider.php index 7c0a209..8d6e755 100644 --- a/src/Providers/LaravelUserMonitoringServiceProvider.php +++ b/src/Providers/LaravelUserMonitoringServiceProvider.php @@ -40,6 +40,7 @@ public function boot() $this->publishConfig(); $this->publishMigrations(); $this->publishViews(); + $this->publishMiddleware(); $this->viewComposer(); } @@ -80,6 +81,18 @@ private function publishViews() ], 'laravel-user-monitoring-views'); } + /** + * Publish middleware files. + * + * @return void + */ + private function publishMiddleware() + { + $this->publishes([ + __DIR__ . '/../Middlewares' => app_path('Http/Middleware'), + ], 'laravel-user-monitoring-middlewares'); + } + /** * View Composer. *