diff --git a/config/sentemails.php b/config/sentemails.php index 2db99bd..2f8cda8 100644 --- a/config/sentemails.php +++ b/config/sentemails.php @@ -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'], ]; \ No newline at end of file diff --git a/src/routes.php b/src/routes.php index aa29939..e1b1cc1 100644 --- a/src/routes.php +++ b/src/routes.php @@ -1,5 +1,5 @@ ['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');