Skip to content

Commit

Permalink
Merge pull request #19 from binafy/add-option-for-publish-middleware
Browse files Browse the repository at this point in the history
[1.x] Add option to publish middlewares
  • Loading branch information
milwad-dev authored Oct 2, 2023
2 parents 956c95e + 5f73ead commit 3208642
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions src/Providers/LaravelUserMonitoringServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public function boot()
$this->publishConfig();
$this->publishMigrations();
$this->publishViews();
$this->publishMiddleware();

$this->viewComposer();
}
Expand Down Expand Up @@ -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.
*
Expand Down

0 comments on commit 3208642

Please sign in to comment.