Skip to content

Instantly share code, notes, and snippets.

@molayli
Created October 11, 2016 13:36
Show Gist options
  • Select an option

  • Save molayli/2cde1317bb81fd2734fdd1a6f63ce46c to your computer and use it in GitHub Desktop.

Select an option

Save molayli/2cde1317bb81fd2734fdd1a6f63ce46c to your computer and use it in GitHub Desktop.

Revisions

  1. molayli created this gist Oct 11, 2016.
    27 changes: 27 additions & 0 deletions helpers.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    <?php

    //.....

    if(!function_exists('freeRedirect')){

    function freeRedirect($to = '/'){

    throw new \Illuminate\Http\Exception\HttpResponseException(redirect($to));
    }

    }
    //.............



    //usage

    class AbcController extends Controller{

    public function aMethod(){
    freeRedirect('/to/another/route');

    }

    }