This commit is contained in:
1day2die 2023-01-13 18:41:32 +01:00
parent 4a79f3194e
commit 540bb95291
5 changed files with 55 additions and 2 deletions

View file

@ -59,6 +59,8 @@ class System
'motd-enabled' => 'string',
'usefullinks-enabled' => 'string',
'motd-message' => 'string|nullable',
'seo-title' => 'string|nullable',
'seo-description' => 'string|nullable',
]);
$validator->after(function ($validator) use ($request) {
@ -111,6 +113,8 @@ class System
"SETTINGS::SYSTEM:MOTD_ENABLED" => "motd-enabled",
"SETTINGS::SYSTEM:MOTD_MESSAGE" => "motd-message",
"SETTINGS::SYSTEM:USEFULLINKS_ENABLED" => "usefullinks-enabled",
"SETTINGS::SYSTEM:SEO_TITLE" => "seo-title",
"SETTINGS::SYSTEM:SEO_DESCRIPTION" => "seo-description",
];
foreach ($values as $key => $value) {

View file

@ -630,5 +630,20 @@ class SettingsSeeder extends Seeder
'type' => 'text',
'description' => 'MOTD Message',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::SYSTEM:SEO_TITLE',
], [
'value' => 'Controlpanel.gg',
'type' => 'text',
'description' => 'The SEO Title',
]);
Settings::firstOrCreate([
'key' => 'SETTINGS::SYSTEM:SEO_DESCRIPTION',
], [
'value' => 'Billing software for Pterodactyl Dashboard!',
'type' => 'text',
'description' => 'SEO Description',
]);
}
}

View file

@ -300,7 +300,35 @@
class="form-control @error('minimum-credits') is-invalid @enderror" required>
</div>
</div>
<div class="row mb-2">
<div class="col text-center">
<h1>{{ __('SEO') }}</h1>
</div>
</div>
<div class="form-group">
<div class="custom-control mb-3 p-0">
<div class="col m-0 p-0 d-flex justify-content-between align-items-center">
<label for="seo-title">{{ __('SEO Title') }}</label>
<i data-toggle="popover" data-trigger="hover" data-html="true"
data-content="{{ __('An SEO title tag must contain your target keyword. This tells both Google and searchers that your web page is relevant to this search query!') }}"
class="fas fa-info-circle"></i>
</div>
<input x-model="seo-title" id="seo-title" name="seo-title"
type="text" value="{{ config('SETTINGS::SYSTEM:SEO_TITLE') }}"
class="form-control @error('seo-title') is-invalid @enderror" required>
</div>
<div class="custom-control mb-3 p-0">
<div class="col m-0 p-0 d-flex justify-content-between align-items-center">
<label for="seo-description">{{ __('SEO Description') }}</label>
<i data-toggle="popover" data-trigger="hover" data-html="true"
data-content="{{ __('The SEO site description represents your homepage. Search engines show this description in search results for your homepage if they dont find content more relevant to a visitors search terms.') }}"
class="fas fa-info-circle"></i>
</div>
<input x-model="seo-description" id="seo-description" name="seo-description"
type="text" value="{{ config('SETTINGS::SYSTEM:SEO_DESCRIPTION') }}"
class="form-control @error('seo-description') is-invalid @enderror" required>
</div>
</div>
</div>
@ -454,7 +482,7 @@
</form>
</div>
<script>tinymce.init({selector:'textarea',skin: "oxide-dark",
content_css: "dark",branding: false, height: 200,
content_css: "dark",branding: false, height: 500,
plugins: ['image','link'],});
</script>

View file

@ -4,6 +4,9 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta content="{{ config('SETTINGS::SYSTEM:SEO_TITLE') }}" property="og:title">
<meta content="{{ config('SETTINGS::SYSTEM:SEO_DESCRIPTION') }}" property="og:description">
<meta content='{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('logo.png') ? asset('storage/logo.png') : asset('images/controlpanel_logo.png') }}' property="og:image">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">

View file

@ -6,6 +6,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<meta content="{{ config('SETTINGS::SYSTEM:SEO_TITLE') }}" property="og:title">
<meta content="{{ config('SETTINGS::SYSTEM:SEO_DESCRIPTION') }}" property="og:description">
<meta content='{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('logo.png') ? asset('storage/logo.png') : asset('images/controlpanel_logo.png') }}' property="og:image">
<title>{{ config('app.name', 'Laravel') }}</title>
<link rel="icon"
href="{{ \Illuminate\Support\Facades\Storage::disk('public')->exists('favicon.ico') ? asset('storage/favicon.ico') : asset('favicon.ico') }}"