PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, February 4, 2022

[FIXED] Redirect to external urls does not work in Laravel 8

 February 04, 2022     laravel, localhost, php, redirect     No comments   

Issue

I'm kind of new to Laravel, when I try to redirect to an external URL I get a blank page. I running the Laravel on my local machine.

This is my web.php

Route::get('/pay', function () {
    
    return view('pay');
});

This is a code that I try to run inside pay.blade.php

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

Solution

Try this

redirect()->to('https://www.google.com')->send();


Answered By - Filip Krzyżanowski
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing