Skip to content

Commit

Permalink
Add public url
Browse files Browse the repository at this point in the history
  • Loading branch information
TitusKirch committed Oct 29, 2023
1 parent 14dcc29 commit c24adaa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
APP_PUBLIC_URL=http://localhost
APP_IS_VPN=false

APP_PORTALS_URL=http://127.0.0.1:8000
Expand Down
8 changes: 7 additions & 1 deletion app/Models/Person.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,15 @@ public function createAuthLink()
{
$this->generateAuthToken();

return route('person.authWithToken', [
// generate the route
$personAuthWithTokenRoute = route('person.authWithToken', [
'id' => $this->id,
'token' => $this->auth_token
]);

// get only the path
$personAuthWithTokenRoute = parse_url($personAuthWithTokenRoute, PHP_URL_PATH);

return config('app.public_url') . $personAuthWithTokenRoute;
}
}
2 changes: 2 additions & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@

'url' => env('APP_URL', 'http://localhost'),

'public_url' => env('APP_PUBLIC_URL', 'http://localhost'),

'asset_url' => env('ASSET_URL', null),

/*
Expand Down

0 comments on commit c24adaa

Please sign in to comment.