Support the ongoing development of Laravel.io →
posted 10 years ago
Requests
Last updated 1 year ago.
0

Print something inside Try or Catch block...just to make sure where's the error coming

Last updated 1 year ago.
0

I did . I tried either side of the if block. I can var_dump or dd() in the try , catch and in the if block , If I return a redirect from the if block it works if I return a string it shows on the page but If I just set the session values weather the person is subscribed or not it fails yet I've written another package for OAuth2-server and I have filters that don't return any thing and they work fine so Im really stuck as to me I can not see a error in the code above. if I add a return to the IF block to return a string i can run the filter with a subscribed user and unsubscribed user and it works Ive never triggered the catch block unless I put a error into the try block then it return the response from the catch block .

Thanks :)

Last updated 1 year ago.
0

Found the issue it was my route eg:

Route::get('my/',['before'=>'sbuscribed'], function(){
        return View::make('hello');
    });

now that what fails so I now tried

Route::get('myy',['before' => 'sbuscribed', 'uses'=> 'HomeController@showWelcome']);

where i route to controller it it works

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

apps4u apps4u Joined 7 Apr 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.