Select Git revision
website-config.blade.php

Sofiane Lasri authored
- Changed the retrieval of the website name in the sidebar component to use the `DbConfig` model for dynamic configuration. - Updated the `set` method in the `DbConfig` model to allow null values for configuration. - Refactored the public layout to use the website name from `DbConfig` instead of a hardcoded value. - Adjusted the default value for maintenance mode and website name in the settings view to match the new configuration method. - Modified the middleware to check the maintenance mode from the `DbConfig` model. - Updated the `SettingsController` to use `has` instead of `filled` for checking request inputs related to maintenance mode and website name.
website-config.blade.php 1.84 KiB
@extends('layouts.admin', ['title' => 'Configuration', 'headerRoutes' => $headerRoutes])
@section('content')
<div class="grid">
<div class="g-col-12 g-col-md-6">
@if (!empty($errors) && $errors->any())
<x-bs.alert type="danger" class="mt-3">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</x-bs.alert>
@endif
@if (session('success'))
<x-bs.alert type="success" class="mt-3">
{{ session('success') }}
</x-bs.alert>
@endif
<h5>Configuration</h5>
<p>Modifiez les paramètres du site internet.</p>
<form action="{{ route('admin.settings.update-website-config') }}"
method="post">
@csrf
@method('PUT')
<x-bs.select label="Statut du mode maintenance"
name="maintenance_mode"
class="mb-3"
:options="['false' => 'Désactivé', 'true' => 'Activé']"
:selected="old('maintenance_mode', \App\Models\DbConfig::get('maintenance_mode', 'true'))"
data-form-type="other"
/>
<x-bs.input label="Nom du site internet"
name="website_name"
class="mb-3"
:value="old('website_name', \App\Models\DbConfig::get('website_name', 'Rann Graphic Design'))"
data-form-type="other"
/>
<x-bs.button type="submit">Enregistrer</x-bs.button>
</form>
</div>
</div>
@endsection