-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[1.x] Allow
redirect()->intended()
responses to be resolved via the…
… Container (#551) * Allow `PasswordBroker` and `redirect()->intended()` responses to be resolved via the Container Signed-off-by: Mior Muhammad Zaki <[email protected]> * Apply fixes from StyleCI * Apply suggestions from code review --------- Signed-off-by: Mior Muhammad Zaki <[email protected]> Co-authored-by: StyleCI Bot <[email protected]>
- Loading branch information
1 parent
ce38a4d
commit 3eaf01e
Showing
3 changed files
with
35 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Laravel\Fortify\Http\Responses; | ||
|
||
use Illuminate\Contracts\Support\Responsable; | ||
use Laravel\Fortify\Fortify; | ||
|
||
class RedirectAsIntended implements Responsable | ||
{ | ||
/** | ||
* Create a new class instance. | ||
* | ||
* @param string $name | ||
* @return void | ||
*/ | ||
public function __construct(public string $name) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Create an HTTP response that represents the object. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @return \Symfony\Component\HttpFoundation\Response | ||
*/ | ||
public function toResponse($request) | ||
{ | ||
return redirect()->intended(Fortify::redirects($this->name)); | ||
} | ||
} |