Skip to content

Commit

Permalink
Allow to configure route middlewares.
Browse files Browse the repository at this point in the history
  • Loading branch information
woodspire committed Jul 22, 2020
1 parent fce9f23 commit 5a6b013
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion config/sentemails.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
*/
return [
//set the route path to load the sent emails ui defaults to /sentemails
'routepath' => 'sentemails'
'routepath' => 'sentemails',

// set the route middlewares to apply on the sent emails ui
'middleware' => ['web', 'auth'],
];
2 changes: 1 addition & 1 deletion src/routes.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
Route::group(['middleware' => ['web', 'auth'], 'namespace' => 'Dcblogdev\LaravelSentEmails\Controllers'], function () {
Route::group(['middleware' => config('sentemails.middleware'), 'namespace' => 'Dcblogdev\LaravelSentEmails\Controllers'], function () {
Route::get(config('sentemails.routepath'), 'SentEmailsController@index');
Route::get(config('sentemails.routepath').'/email/{id}', 'SentEmailsController@email');
Route::get(config('sentemails.routepath').'/body/{id}', 'SentEmailsController@body');
Expand Down

0 comments on commit 5a6b013

Please sign in to comment.