Skip to content

Instantly share code, notes, and snippets.

@sineld
Forked from JeffreyWay/snippet.xml
Created September 13, 2012 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sineld/3717383 to your computer and use it in GitHub Desktop.
Save sineld/3717383 to your computer and use it in GitHub Desktop.
Laravel Resource - Sublime Text 2 Snippet
<snippet>
<content><![CDATA[
// ${1} Resource
Route::get('${1}s', array('as' => '${1}s', 'uses' => '${1}s@index'));
Route::get('${1}s/(:any)', array('as' => '${1}', 'uses' => '${1}s@show'));
Route::get('${1}s/new', array('as' => 'new_${1}', 'uses' => '${1}s@new'));
Route::get('${1}s/(:any)edit', array('as' => 'edit_${1}', 'uses' => '${1}s@edit'));
Route::post('${1}s', '${1}s@create');
Route::put('${1}s/(:any)', '${1}s@update');
Route::delete('${1}s/(:any)', '${1}s@destroy');
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>resource</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>
@pbohny
Copy link

pbohny commented Nov 10, 2012

I have been following your fantastic videos on nettuts premium. It's a great pleasure, the tempo is perfect and the quality of information is outstanding.

Is it possible that in this snippet it should read (:any)/edit nistend of (:any)edit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment