From a1a9ab76bb83f41bbe19521cc5a69412b3b1d83a Mon Sep 17 00:00:00 2001 From: edmondlang Date: Sun, 13 Mar 2022 22:06:11 +0800 Subject: [PATCH] tidy up route and put reports route inside report.php --- routes/api.php | 5 +---- routes/report.php | 13 +++++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 routes/report.php diff --git a/routes/api.php b/routes/api.php index c8f886e1..d7d0cdcc 100644 --- a/routes/api.php +++ b/routes/api.php @@ -54,10 +54,7 @@ Route::group(['middleware' => 'api', 'prefix' => 'v1', 'as' => 'api.'], function require __DIR__ . '/announcement.php'; - Route::get('/report/customer/{marking}/{from?}/{to?}', 'Reports\MonthlyReportController@customerReport')->name('report.customer'); - Route::get('/report/sales/{from?}/{to?}', 'Reports\MonthlyReportController@salesReport')->name('report.sales'); - Route::get('/report/profit/{model}/{value}/{from?}/{to?}', 'Reports\MonthlyReportController@profitModelReport')->name('report.profit'); - Route::get('/report/service', 'Reports\MonthlyReportController@serviceReport')->name('report.service'); + require __DIR__ . '/report.php'; }); diff --git a/routes/report.php b/routes/report.php new file mode 100644 index 00000000..cd084cf6 --- /dev/null +++ b/routes/report.php @@ -0,0 +1,13 @@ + 'report', 'as' => 'report.', 'namespace' => 'Reports'], function () { + Route::get('/customer/{marking}/{from?}/{to?}', 'MonthlyReportController@customerReport')->name('customer'); + + Route::get('/sales/{from?}/{to?}', 'MonthlyReportController@salesReport')->name('sales'); + + Route::get('/profit/{model}/{value}/{from?}/{to?}', 'MonthlyReportController@profitModelReport')->name('profit'); + + Route::get('/service', 'MonthlyReportController@serviceReport')->name('service'); +});