Laravel 5: redirect to an external link outside of localhost/server

前端 未结 4 1495
说谎
说谎 2021-01-17 08:46

I want to build an app with laravel 5 & dropbox API in which I want the API allow/cancel-warning to be displayed when you land on the homepage, not when you click a butt

相关标签:
4条回答
  • 2021-01-17 08:51

    This code works for me:

    return redirect()->away('https://www.dropbox.com');
    

    Make sure you also add a return (i.e. return $this->checkSession();) in start().

    0 讨论(0)
  • 2021-01-17 08:51

    Below code will work

    return redirect()->away('http://www.paypal.com');
    

    And this will also work.

    return redirect('http://www.paypal.com');
    
    0 讨论(0)
  • 2021-01-17 08:56

    For https and such use the following

    return redirect()->to($refererUrl);
    
    0 讨论(0)
  • 2021-01-17 08:59

    Can do this,

    use Redirect;
    
    return Redirect::to('your url');
    

    Or just,

    return \Redirect::to('your url');
    
    0 讨论(0)
提交回复
热议问题