KHAN's avatar
Level 4

[HELP] Route::get and Route::Resource

Hi,

I am following the "Larabook" series after completing the "Getting Started With Laravel 4" Series.

I am confused why he has gone back to using Route::get, instead of Route::resource.

Example 1.

  • Route::get('/', 'PagesController@home');

  • Route::resource('/', 'PagesController');

Example 2

  • Route::get('register', [ 'as' => 'register_path', 'uses' => 'RegistrationController@create' ]);

^ I really don't get this implementation. Then in the create.blade.php he references

{{ Form::open(['route' => 'register_path']) }}

  • Route::resource('register', 'RegistrationController');

Then in the create.blade.php could you not just use.

{{Form::open(['route' => 'register/create'])}}

Am i wrong in thinking this? Is there a reason you should use get instead of resource and resource instead of get.

0 likes
3 replies
KHAN's avatar
Level 4

@Milon521

Right, so my question was why is in this instant is he using get over resource? I assume larabook is a later series than getting started with laravel 4. Little confusing to me why he would implement it this way when he has taught us a better way to do it, unless there is a reason?

Please or to participate in this conversation.