laravel - Do nothing if route filter fails check -


i have route filter want nothing if filter fails check.

i'm doing restricted area, don't want redirect if fails, i'd rather user stay right at.

route::group(array("prefix"=>"protected", "before"=>"level:3"),function(){ ... }  route::filter('level', function($route, $request, $value) {     if(auth::user()->level < $value) // nothing } 

unfortunately, doing nothing results in access page. doing route::back() seems work, except there's not page refresh 1 isn't necessary , confuse user. ideas?

you have understand if doing common form post (or get) send data, did big: have sent request , cannot take back. page user gone , he's in new page. have @ least render view again:

return view::make('my.very.same.view'); 

it may blink/flash, , looks has happened page.

so if need, in case of exception or error, stay in same page, have send data using ajax , if it's right data, whatever need do.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -