Skip to content

Commit

Permalink
Merge pull request #3 from woodspire/feature/config-route-middleware
Browse files Browse the repository at this point in the history
Allow to configure route middlewares.
  • Loading branch information
dcblogdev authored Jul 23, 2020
2 parents fce9f23 + 5a6b013 commit ff5ab26
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 ff5ab26

Please sign in to comment.