From 5f73eade4e219054a0af1c5fdc35cf74476e0d94 Mon Sep 17 00:00:00 2001 From: miladev-ent <98118400+milwad-dev@users.noreply.github.com> Date: Mon, 2 Oct 2023 15:41:56 +0330 Subject: [PATCH] wip --- README.md | 14 +++++++++++++- .../LaravelUserMonitoringServiceProvider.php | 13 +++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) 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. *