This Solved My Authentication Redirect Problem

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ม.ค. 2025

ความคิดเห็น • 8

  • @devhammed
    @devhammed 15 วันที่ผ่านมา +22

    Laravel actually have "setIntendedUrl" and "intended" methods in the redirector to solve this exact problem:
    return redirect()
    ->setIntendedUrl(request()->fullUrl())
    ->route('register');
    Then after login, you can do this:
    return redirect()->intended('/');

    • @joshcirre
      @joshcirre  15 วันที่ผ่านมา +7

      This is exactly it! I knew that intended() alone did not last for multiple page redirections, but I did not know about setIntendedUrl. You learn something new everyday!
      👀

    • @devhammed
      @devhammed 15 วันที่ผ่านมา +3

      @joshcirre I'm glad that was helpful.
      I guess you have some refactoring to do.
      😀😀😀

  • @rodrigorios78
    @rodrigorios78 14 วันที่ผ่านมา

    This is the kind of content I feel like that brings so much value to developers: how to solve X (not being something too trivial, but also not too specific). It doesn't need to be THE best way to solving X, but it's some way. It is the reason I'm considering creating a YT channel to share the smartest solutions I came up with, during all my time working with Laravel.

  • @rodrigorios78
    @rodrigorios78 14 วันที่ผ่านมา +1

    Great video Josh! Would you mind sharing which extension/setting you used to make the panel look like that at 3:47? Thanks!

  • @christostsangaris4785
    @christostsangaris4785 12 วันที่ผ่านมา

    @josh Great content as always! Just a note: I feel that there is a slight delay between the video and the audio.