Suppose I had a controller that look like this:
AController.php
<?php namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
class AController extends Controller {
public function doThis(){...}
public function doThat(){...}
public function doThing(){...}
}
routes.php
Route::get('/doThis', [
'as' => 'acontroller.dothis', 'uses' => 'AController@doThis'
]);
Route::get('/doThis', [
'as' => 'acontroller.dothat', 'uses' => 'AController@doThat'
]);
Route::get('/doThis', [
'as' => 'acontroller.dothing', 'uses' => 'AController@doThing'
]);
Is there a better way than using Route::get()
? I want my route to be automatically ControllerName.methodName
and the url to be /methodName
without having to explicitly use Route::get()