Skip to content

Commit 4a96707

Browse files
committed
embed the overview settings from the config - this speed up page load as the config gets cached where .env does not
1 parent d216f36 commit 4a96707

File tree

2 files changed

+23
-13
lines changed

2 files changed

+23
-13
lines changed

config/app.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
return [
44

5+
'title' => env('APP_TITLE', 'Fallback Title'),
6+
'description' => env('APP_DESCRIPTION', 'Fallback Description'),
7+
'author' => env('APP_AUTHOR', 'Fallback Author'),
8+
'keywords' => env('APP_KEYWORDS', 'laravel'),
9+
10+
'facebook_id' => env('FACEBOOK_APP_ID', ''),
11+
'recaptcha_public_key' => env('RECAPTCHA_PUBLIC_KEY', ''),
12+
'google_analytics' => env('GOOGLE_ANALYTICS', ''),
13+
'google_map_key' => env('GOOGLE_MAP_KEY', ''),
14+
515
/*
616
|--------------------------------------------------------------------------
717
| Application Environment

resources/views/layouts/website.blade.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@
44
<meta charset="utf-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width, initial-scale=1">
7-
<meta name="author" content="{!! env('APP_AUTHOR') !!}">
8-
<meta name="keywords" content="{!! env('APP_KEYWORDS') !!}">
9-
<meta name="description" content="{!! isset($HTMLDescription) ? $HTMLDescription : env('APP_DESCRIPTION') !!}"/>
7+
<meta name="author" content="{{ config('app.author') }}">
8+
<meta name="keywords" content="{{ config('app.keywords') }}">
9+
<meta name="description" content="{{ isset($HTMLDescription) ? $HTMLDescription : config('app.description') }}"/>
1010

1111
<meta property="og:type" name="og:type" content="website"/>
12-
<meta property="og:site_name" content="{{ env('APP_TITLE') }}" />
12+
<meta property="og:site_name" content="{{ config('app.title') }}"/>
1313
<meta property="og:url" name="og:url" content="{{ Request::url() }}"/>
14-
<meta property="og:caption" name="og:caption" content="{{ env('APP_URL') }}"/>
15-
<meta property="fb:app_id" name="fb:app_id" content="{{ env('FACEBOOK_APP_ID') }}"/>
16-
<meta property="og:title" name="og:title" content="{{ isset($HTMLTitle) ? $HTMLTitle : env('APP_TITLE') }}">
17-
<meta property="og:description" name="og:description" content="{!! isset($HTMLDescription) ? $HTMLDescription : env('APP_DESCRIPTION') !!}">
18-
<meta property="og:image" name="og:image" content="{{ env('APP_URL') }}{{ isset($HTMLImage) ? $HTMLImage : 'images/logo.png' }}">
14+
<meta property="og:caption" name="og:caption" content="{{ config('app.url') }}"/>
15+
<meta property="fb:app_id" name="fb:app_id" content="{{ config('app.facebook_id') }}"/>
16+
<meta property="og:title" name="og:title" content="{{ isset($HTMLTitle) ? $HTMLTitle : config('app.title') }}">
17+
<meta property="og:description" name="og:description" content="{{ isset($HTMLDescription) ? $HTMLDescription : config('app.description') }}">
18+
<meta property="og:image" name="og:image" content="{{ config('app.url') }}{{ isset($HTMLImage) ? $HTMLImage : 'images/logo.png' }}">
1919

20-
<title>{{ isset($HTMLTitle) ? $HTMLTitle : env('APP_TITLE') }}</title>
20+
<title>{{ isset($HTMLTitle) ? $HTMLTitle : config('app.title') }}</title>
2121

2222
<link rel="shortcut icon" type="image/ico" href="/favicon.ico">
2323

2424
{{-- google font --}}
25-
@if(env('APP_ENV') != 'local')
25+
@if(config('app.env') != 'local')
2626
@endif
2727

2828
{{-- stylesheet --}}
@@ -31,7 +31,7 @@
3131

3232
<body>
3333
{{-- facebook root --}}
34-
@if(env('APP_ENV') != 'local')
34+
@if(config('app.env') != 'local')
3535
@include('partials.facebook')
3636
@endif
3737

@@ -60,7 +60,7 @@
6060
{{-- page specific scripts --}}
6161
@yield('scripts')
6262

63-
@if(env('APP_ENV') != 'local')
63+
@if(config('app.env') != 'local')
6464
@include('partials.google_analytics')
6565
@endif
6666
</body>

0 commit comments

Comments
 (0)