Skip to content

Commit

Permalink
replace env() with config()
Browse files Browse the repository at this point in the history
env() should only be used inside config files as it returns null when the config is cached.
  • Loading branch information
pryley committed Aug 28, 2020
1 parent 424de27 commit 48c181e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/Http/Controllers/DynamicToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ class DynamicToken extends Controller
public function getRefresh(Request $request)
{
// Determine if the request is actually coming from our own website on non local enviroments.
if (env('APP_ENV') != 'local')
if (config('app.env') != 'local')
{
$referer = request()->headers->get('referer');
$startWithAppUrl = starts_with($referer, env('APP_URL'));
$startWithAppUrl = starts_with($referer, config('app.url'));
if (empty($referer) || !$startWithAppUrl) {
abort(404);
}
}

return csrf_token();
}
}
}
6 changes: 3 additions & 3 deletions resources/lang/en/site.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
'form_mail_body_sender' => 'Thanks for your message. We will contact you as soon as possible.',
'form_mail_body_owner' => 'A contact form has been sent.',
'form_mail_closing' => 'Kind regards',
'form_mail_from' => env('APP_NAME'),
'form_mail_url' => env('APP_URL'),
'form_mail_from' => config('app.name'),
'form_mail_url' => config('app.url'),
'form_mail_logo' => 'https://studio1902.ams3.cdn.digitaloceanspaces.com/assets/statamic-peak/statamic-peak-logo.svg',
];
];

0 comments on commit 48c181e

Please sign in to comment.