get('/user', function (Request $request) { return $request->user(); }); Route::group(['middleware' => 'auth:api'], function(){ Route::apiResource('twofaccounts', 'TwoFAccountController'); Route::get('twofaccounts/{twofaccount}/totp', 'TwoFAccountController@generateTOTP')->name('twofaccounts.generateTOTP'); Route::delete('twofaccounts/force/{id}', 'TwoFAccountController@forceDestroy')->name('twofaccounts.forceDestroy'); });