Support the ongoing development of Laravel.io →
posted 6 years ago
Last updated 3 years ago.
0
if(!function_exists('freeRedirect')){
   
  function freeRedirect($to = '/'){
    
      throw new \Illuminate\Http\Exception\HttpResponseException(redirect($to));
  }
  
}

Source

0

Hmmm that looks like witch craft to me. I am going to give that a try.

Failing that, is it just a given that the first function calls to a controller just has all other function calls contained inside of a try catch? and then throw them all from lower down?

0

Sign in to participate in this thread!

PHPverse

Your banner here too?

Ben ben199131837575 Joined 18 Mar 2019

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.

© 2025 Laravel.io - All rights reserved.