Friday 15 February 2013

laravel - Auth on create resource causing routing problems -


I am trying to require auth before reaching a resource and have separated my resource paths accordingly.

  Root: Resources (except for 'Post', 'Post Controller', ['' '' '[' Store ',' Edit ',' Update ',' Destroyed ' , 'Create']]; Root :: Groups (['first' = & gt; 'at'], function () {root :: resource ('post', 'post controller', ['' only '= & gt; ; ['Store', 'Edit' 'Update', 'Destroy', 'Create']]);});   

Now for any reason to post / Creates are redirected to the way of showing me. And at other ways all the way is working properly, and when I If it is removed, then it asks for entry to post it, but obviously I would like to limit the limit to this section.

I recommend that you use it instead.

This simplifies routing on:

  root :: Resources ('Post', 'Post Controller');   

And in the manufacturer of your post controller, you can configure the filter:

  Public f Function __construct () {$ this-> beforeFilter ('auth', array (except '' = & gt; Array ('index', 'show'))); }    

No comments:

Post a Comment