Skip to content

Commit

Permalink
Test angular routing hack
Browse files Browse the repository at this point in the history
  • Loading branch information
williamjallen committed Oct 23, 2023
1 parent 910f175 commit b78707f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public function boot()

// This allows us to do response()->angular_view(<view_name>).
Response::macro('angular_view', function (string $view_name) {
// A hack to ensure that redirects work properly after being redirected to the login page
session(['url.intended' => url()->current()]);

$controller_name = '';
$path = request()->path() === '/' ? 'index.php' : request()->path();
$file = pathinfo(substr($path, strrpos($path, '/')), PATHINFO_FILENAME);
Expand Down

0 comments on commit b78707f

Please sign in to comment.