Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Laravel Resource Route Expanded Sublime Snippet
Route::get('${1:resource}', ['as' => '${1}.index', 'uses' => '${1/(.+)/\u\1/g}sController@index']);
Route::get('${1}/create', ['as' => '${1}.create', 'uses' => '${1/(.+)/\u\1/g}sController@create']);
Route::post('${1}', ['as' => '${1}.store', 'uses' => '${1/(.+)/\u\1/g}sController@store']);
Route::get('${1}/{${1}}', ['as' => '${1}.show', 'uses' => '${1/(.+)/\u\1/g}sController@show']);
Route::get('${1}/{${1}}/edit', ['as' => '${1}.edit', 'uses' => '${1/(.+)/\u\1/g}sController@edit']);
Route::put('${1}/{${1}}', ['as' => '${1}.update', 'uses' => '${1/(.+)/\u\1/g}sController@update']);
Route::patch('${1}/{${1}}', ['uses' => '${1/(.+)/\u\1/g}sController@update']);
Route::delete('${1}/{${1}}', ['as' => '${1}.destroy', 'uses' => '${1/(.+)/\u\1/g}sController@destroy']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.