Skip to content

Commit

Permalink
Merge pull request #63 from jd-dotlogics/bugfix/add_middlewares_to_co…
Browse files Browse the repository at this point in the history
…nfig

Protected the routes with middlewares and added middleware option in …
  • Loading branch information
mjawad096 authored Oct 25, 2022
2 parents fe3b30b + c222332 commit dbeb175
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
5 changes: 4 additions & 1 deletion src/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
'force_class' => false,
'fonts' => [],
'styles' => [],
'scripts' => []
'scripts' => [],
'middleware' => [
'web', 'auth'
],
];
22 changes: 13 additions & 9 deletions src/routes/grapesjs.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
use Illuminate\Support\Facades\Route;


Route::prefix('grapesjs')->name('grapesjs.')->namespace('Dotlogics\Grapesjs\App\Http\Controllers')->group(function(){
Route::post('editor/asset/store', 'AssetController@store')->name('editor.asset.store');

Route::get('editor/{model}/{editable}', 'EditorController@editor')->name('editor.model.editor');
Route::post('editor/{model}/{editable}', 'EditorController@store')->name('editor.model.store');

Route::get('editor/{model}/{editable}/templates', 'EditorController@templates')->name('editor.model.templates');
Route::get('editor/templates', 'EditorController@templates')->name('editor.templates');
});
Route::prefix('grapesjs')
->name('grapesjs.')
->namespace('Dotlogics\Grapesjs\App\Http\Controllers')
->middleware(config('grapesjs.middleware', []))
->group(function(){
Route::post('editor/asset/store', 'AssetController@store')->name('editor.asset.store');

Route::get('editor/{model}/{editable}', 'EditorController@editor')->name('editor.model.editor');
Route::post('editor/{model}/{editable}', 'EditorController@store')->name('editor.model.store');

Route::get('editor/{model}/{editable}/templates', 'EditorController@templates')->name('editor.model.templates');
Route::get('editor/templates', 'EditorController@templates')->name('editor.templates');
});

0 comments on commit dbeb175

Please sign in to comment.