Switch to using tuple notation for routes
MODIFY
app/Providers/RouteServiceProvider.php
app/Providers/RouteServiceProvider.php
@@ -52,7 +52,6 @@ class RouteServiceProvider extends ServiceProvider
protected function mapWebRoutes()
{
Route::middleware('web')
- ->namespace($this->namespace)
->group(base_path('routes/web.php'));
}

MODIFY
routes/web.php
routes/web.php
<?php
-Route::get('/', 'IndexController@index')->name('index');
+use App\Http\Controllers\ActivityController;
+use App\Http\Controllers\AttachmentController;
+use App\Http\Controllers\DashboardController;
+use App\Http\Controllers\EarningController;
+use App\Http\Controllers\IdeaController;
+use App\Http\Controllers\ImportController;
+use App\Http\Controllers\IndexController;
+use App\Http\Controllers\LoginController;
+use App\Http\Controllers\LogoutController;
+use App\Http\Controllers\RecurringController;
+use App\Http\Controllers\RegisterController;
+use App\Http\Controllers\ReportController;
+use App\Http\Controllers\ResetPasswordController;
+use App\Http\Controllers\SettingsController;
+use App\Http\Controllers\SpaceController;
+use App\Http\Controllers\SpendingController;
+use App\Http\Controllers\TagController;
+use App\Http\Controllers\TransactionController;
+use App\Http\Controllers\VerifyController;
+
+Route::get('/', [IndexController::class, 'index'])->name('index');
Route::group(['middleware' => ['guest']], function () {
- Route::get('/login', 'LoginController@index')->name('login');
- Route::post('/login', 'LoginController@store');
+ Route::get('/login', [LoginController::class, 'index'])->name('login');
+ Route::post('/login', [LoginController::class, 'store']);
- Route::get('/verify/{token}', 'VerifyController')->name('verify');
+ Route::get('/verify/{token}', VerifyController::class)->name('verify');
- Route::get('/reset_password', 'ResetPasswordController@get')->name('reset_password');
- Route::post('/reset_password', 'ResetPasswordController@post');
+ Route::get('/reset_password', [ResetPasswordController::class, 'get'])->name('reset_password');
+ Route::post('/reset_password', [ResetPasswordController::class, 'post']);
- Route::get('/register', 'RegisterController@index')->name('register');
- Route::post('/register', 'RegisterController@store');
+ Route::get('/register', [RegisterController::class, 'index'])->name('register');
+ Route::post('/register', [RegisterController::class, 'store']);
});
Route::group(['middleware' => ['auth']], function () {
- Route::get('/dashboard', 'DashboardController')->name('dashboard');
+ Route::get('/dashboard', DashboardController::class)->name('dashboard');
- Route::post('/attachments', 'AttachmentController@store');
- Route::get('/attachments/{attachment}/download', 'AttachmentController@download');
- Route::post('/attachments/{id}/delete', 'AttachmentController@delete');
+ Route::post('/attachments', [AttachmentController::class, 'store']);
+ Route::get('/attachments/{attachment}/download', [AttachmentController::class, 'download']);
+ Route::post('/attachments/{id}/delete', [AttachmentController::class, 'delete']);
- Route::get('/transactions/create', 'TransactionController@create')->name('transactions.create');
+ Route::get('/transactions/create', [TransactionController::class, 'create'])->name('transactions.create');
Route::name('transactions.')->group(function () {
- Route::get('/transactions', 'TransactionController@index')->name('index');
- Route::get('/transactions/create', 'TransactionController@create')->name('create');
+ Route::get('/transactions', [TransactionController::class, 'index'])->name('index');
+ Route::get('/transactions/create', [TransactionController::class, 'create'])->name('create');
});
Route::name('earnings.')->group(function () {
- Route::get('/earnings/{earning}', 'EarningController@show')->name('show');
- Route::get('/earnings/create', 'EarningController@create')->name('create');
- Route::post('/earnings', 'EarningController@store');
- Route::get('/earnings/{earning}/edit', 'EarningController@edit')->name('edit');
- Route::patch('/earnings/{earning}', 'EarningController@update');
- Route::delete('/earnings/{earning}', 'EarningController@destroy');
- Route::post('/earnings/{id}/restore', 'EarningController@restore');
+ Route::get('/earnings/{earning}', [EarningController::class, 'show'])->name('show');
+ Route::get('/earnings/create', [EarningController::class, 'create'])->name('create');
+ Route::post('/earnings', [EarningController::class, 'store']);
+ Route::get('/earnings/{earning}/edit', [EarningController::class, 'edit'])->name('edit');
+ Route::patch('/earnings/{earning}', [EarningController::class, 'update']);
+ Route::delete('/earnings/{earning}', [EarningController::class, 'destroy']);
+ Route::post('/earnings/{id}/restore', [EarningController::class, 'restore']);
});
Route::name('spendings.')->group(function () {
- Route::get('/spendings/{spending}', 'SpendingController@show')->name('show');
- Route::get('/spendings/create', 'SpendingController@create')->name('create');
- Route::post('/spendings', 'SpendingController@store');
- Route::get('/spendings/{spending}/edit', 'SpendingController@edit')->name('edit');
- Route::patch('/spendings/{spending}', 'SpendingController@update');
- Route::delete('/spendings/{spending}', 'SpendingController@destroy');
- Route::post('/spendings/{id}/restore', 'SpendingController@restore');
+ Route::get('/spendings/{spending}', [SpendingController::class, 'show'])->name('show');
+ Route::get('/spendings/create', [SpendingController::class, 'create'])->name('create');
+ Route::post('/spendings', [SpendingController::class, 'store']);
+ Route::get('/spendings/{spending}/edit', [SpendingController::class, 'edit'])->name('edit');
+ Route::patch('/spendings/{spending}', [SpendingController::class, 'update']);
+ Route::delete('/spendings/{spending}', [SpendingController::class, 'destroy']);
+ Route::post('/spendings/{id}/restore', [SpendingController::class, 'restore']);
});
- Route::resource('/recurrings', 'RecurringController')->only([
+ Route::resource('/recurrings', RecurringController::class)->only([
'index',
'create',
'store',
'show'
]);
- Route::resource('/tags', 'TagController')->only([
+ Route::resource('/tags', TagController::class)->only([
'index',
'create',
'store',
@@ -65,38 +85,38 @@ Route::group(['middleware' => ['auth']], function () {
'destroy'
]);
- Route::get('/reports', 'ReportController@index')->name('reports.index');
- Route::get('/reports/{slug}', 'ReportController@show');
+ Route::get('/reports', [ReportController::class, 'index'])->name('reports.index');
+ Route::get('/reports/{slug}', [ReportController::class, 'show']);
Route::name('imports.')->group(function () {
- Route::get('/imports', 'ImportController@index')->name('index');
- Route::get('/imports/create', 'ImportController@create')->name('create');
- Route::post('/imports', 'ImportController@store')->name('store');
- Route::get('/imports/{import}/prepare', 'ImportController@getPrepare')->name('prepare');
- Route::post('/imports/{import}/prepare', 'ImportController@postPrepare');
- Route::get('/imports/{import}/complete', 'ImportController@getComplete')->name('complete');
- Route::post('/imports/{import}/complete', 'ImportController@postComplete');
- Route::delete('/imports/{import}', 'ImportController@destroy');
+ Route::get('/imports', [ImportController::class, 'index'])->name('index');
+ Route::get('/imports/create', [ImportController::class, 'create'])->name('create');
+ Route::post('/imports', [ImportController::class, 'store'])->name('store');
+ Route::get('/imports/{import}/prepare', [ImportController::class, 'getPrepare'])->name('prepare');
+ Route::post('/imports/{import}/prepare', [ImportController::class, 'postPrepare']);
+ Route::get('/imports/{import}/complete', [ImportController::class, 'getComplete'])->name('complete');
+ Route::post('/imports/{import}/complete', [ImportController::class, 'postComplete']);
+ Route::delete('/imports/{import}', [ImportController::class, 'destroy']);
});
Route::name('activities.')->group(function () {
- Route::get('/activities', 'ActivityController@index')->name('index');
+ Route::get('/activities', [ActivityController::class, 'index'])->name('index');
});
Route::name('settings.')->group(function () {
- Route::get('/settings', 'SettingsController@getIndex')->name('index');
- Route::post('/settings', 'SettingsController@postIndex');
- Route::get('/settings/profile', 'SettingsController@getProfile')->name('profile');
- Route::get('/settings/account', 'SettingsController@getAccount')->name('account');
- Route::get('/settings/preferences', 'SettingsController@getPreferences')->name('preferences');
- Route::get('/settings/spaces', 'SettingsController@getSpaces')->name('spaces.index');
+ Route::get('/settings', [SettingsController::class, 'getIndex'])->name('index');
+ Route::post('/settings', [SettingsController::class, 'postIndex']);
+ Route::get('/settings/profile', [SettingsController::class, 'getProfile'])->name('profile');
+ Route::get('/settings/account', [SettingsController::class, 'getAccount'])->name('account');
+ Route::get('/settings/preferences', [SettingsController::class, 'getPreferences'])->name('preferences');
+ Route::get('/settings/spaces', [SettingsController::class, 'getSpaces'])->name('spaces.index');
});
- Route::get('/spaces/{id}', 'SpaceController');
+ Route::get('/spaces/{id}', SpaceController::class);
Route::name('ideas.')->group(function () {
- Route::get('/ideas/create', 'IdeaController@create')->name('create');
- Route::post('/ideas', 'IdeaController@store');
+ Route::get('/ideas/create', [IdeaController::class, 'create'])->name('create');
+ Route::post('/ideas', [IdeaController::class, 'store']);
});
Route::get('/translations', function () {
@@ -112,4 +132,4 @@ Route::group(['middleware' => ['auth']], function () {
});
});
-Route::get('/logout', 'LogoutController@index')->name('logout');
+Route::get('/logout', [LogoutController::class, 'index'])->name('logout');

Switch to using tuple notation for routes