From 42b7d4acfdacc2f43e266db21a01acda2bc58241 Mon Sep 17 00:00:00 2001 From: Yassine Date: Thu, 9 May 2019 17:00:34 +0000 Subject: [PATCH] add route groups --- src/Http/routes.php | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/src/Http/routes.php b/src/Http/routes.php index 4d23c24..c548400 100644 --- a/src/Http/routes.php +++ b/src/Http/routes.php @@ -1,23 +1,27 @@ name('templateList'); -Route::get('/templates/new', 'TemplatesController@select')->name('selectNewTemplate'); -Route::get('/templates/new/{type}/{name}/{skeleton}', 'TemplatesController@new')->name('newTemplate'); -Route::get('/templates/edit/{templatename}', 'TemplatesController@view')->name('viewTemplate'); -Route::post('/templates/new', 'TemplatesController@create')->name('createNewTemplate'); -Route::post('/templates/delete', 'TemplatesController@delete')->name('deleteTemplate'); -Route::post('/templates/update', 'TemplatesController@update')->name('updateTemplate'); -Route::post('/templates/preview', 'TemplatesController@previewTemplateMarkdownView')->name('previewTemplateMarkdownView'); -Route::get('/mailables', 'MailablesController@index')->name('mailableList'); -Route::get('/mailables/view/{name}', 'MailablesController@viewMailable')->name('viewMailable'); -Route::get('/mailables/edit/template/{name}', 'MailablesController@editMailable')->name('editMailable'); -Route::post('/mailables/parse/template', 'MailablesController@parseTemplate')->name('parseTemplate'); -Route::post('/mailables/preview/template', 'MailablesController@previewMarkdownView')->name('previewMarkdownView'); +Route::group(['prefix' => 'templates'], function(){ + Route::get('/', 'TemplatesController@index')->name('templateList'); + Route::get('new', 'TemplatesController@select')->name('selectNewTemplate'); + Route::get('new/{type}/{name}/{skeleton}', 'TemplatesController@new')->name('newTemplate'); + Route::get('edit/{templatename}', 'TemplatesController@view')->name('viewTemplate'); + Route::post('new', 'TemplatesController@create')->name('createNewTemplate'); + Route::post('delete', 'TemplatesController@delete')->name('deleteTemplate'); + Route::post('update', 'TemplatesController@update')->name('updateTemplate'); + Route::post('preview', 'TemplatesController@previewTemplateMarkdownView')->name('previewTemplateMarkdownView'); +}); -Route::get('/mailables/preview/template/previewerror', 'MailablesController@templatePreviewError')->name('templatePreviewError'); -Route::get('/mailables/preview/{name}', 'MailablesController@previewMailable')->name('previewMailable'); -Route::get('/mailables/new', 'MailablesController@createMailable')->name('createMailable'); -Route::post('/mailables/new', 'MailablesController@generateMailable')->name('generateMailable'); -Route::post('/mailables/delete', 'MailablesController@delete')->name('deleteMailable'); \ No newline at end of file +Route::group(['prefix' => 'mailables'], function(){ + Route::get('/', 'MailablesController@index')->name('mailableList'); + Route::get('view/{name}', 'MailablesController@viewMailable')->name('viewMailable'); + Route::get('edit/template/{name}', 'MailablesController@editMailable')->name('editMailable'); + Route::post('parse/template', 'MailablesController@parseTemplate')->name('parseTemplate'); + Route::post('preview/template', 'MailablesController@previewMarkdownView')->name('previewMarkdownView'); + Route::get('preview/template/previewerror', 'MailablesController@templatePreviewError')->name('templatePreviewError'); + Route::get('preview/{name}', 'MailablesController@previewMailable')->name('previewMailable'); + Route::get('new', 'MailablesController@createMailable')->name('createMailable'); + Route::post('new', 'MailablesController@generateMailable')->name('generateMailable'); + Route::post('delete', 'MailablesController@delete')->name('deleteMailable'); +}); \ No newline at end of file