diff --git a/app/Http/Requests/Bo/Settings/UpdateSettingsRequest.php b/app/Http/Requests/Bo/Settings/UpdateSettingsRequest.php index 34d628f..a15f334 100644 --- a/app/Http/Requests/Bo/Settings/UpdateSettingsRequest.php +++ b/app/Http/Requests/Bo/Settings/UpdateSettingsRequest.php @@ -52,6 +52,8 @@ class UpdateSettingsRequest extends FormRequest { return [ 'name' => 'required|string|min:3|max:255', + 'company' => 'required|string|min:3|max:255', + 'start_date' => 'required|date', 'end_date' => 'required|date', 'nb_participation_player' => 'required|numeric|min:0', @@ -101,6 +103,7 @@ class UpdateSettingsRequest extends FormRequest { return [ 'name' => trans('validation.attributes.name'), + 'company' => trans('validation.custom.company'), 'start_date' => trans('validation.custom.start_date'), 'end_date' => trans('validation.custom.end_date'), 'nb_participation_player' => trans('validation.custom.nb_participation_player'), diff --git a/app/Mail/NotifAdmin.php b/app/Mail/NotifAdmin.php index aa2d7d8..8bf4dcd 100644 --- a/app/Mail/NotifAdmin.php +++ b/app/Mail/NotifAdmin.php @@ -33,7 +33,9 @@ class NotifAdmin extends Mailable implements ShouldQueue */ public function build() { - $msg = $this->msg; - return $this->subject(config('app.name') . " : Erreur")->view('front.basic.notif-admin', compact('msg')); + /** @var \App\Models\Settings */ + $settings = app(Settings::class); + $msg = $this->msg; + return $this->subject("{$settings->name} : Erreur")->view('front.basic.notif-admin', compact('msg')); } } diff --git a/app/Models/Settings.php b/app/Models/Settings.php index df9e0e6..ef94de5 100644 --- a/app/Models/Settings.php +++ b/app/Models/Settings.php @@ -8,7 +8,8 @@ use Illuminate\Database\Eloquent\Model; /** * Settings. * - * @property string $name Name + * @property string $name The game name + * @property string $company Name of the company that organizes the game * @property \Illuminate\Support\Carbon $start_date Start date of the game * @property \Illuminate\Support\Carbon $end_date End date of the game * @property int $nb_participation_player Max paticipation per player @@ -41,6 +42,7 @@ class Settings extends Model */ protected $fillable = [ 'name', + 'company', 'start_date', 'end_date', 'nb_participation_player', diff --git a/app/Notifications/Customer/DestroyCustomer.php b/app/Notifications/Customer/DestroyCustomer.php index b0f0a3b..50bbc66 100644 --- a/app/Notifications/Customer/DestroyCustomer.php +++ b/app/Notifications/Customer/DestroyCustomer.php @@ -28,12 +28,15 @@ class DestroyCustomer extends Notification */ public function toMail(object $notifiable): MailMessage { + /** @var \App\Models\Settings */ + $settings = app(Settings::class); + /** @var string $first_name */ $first_name = $notifiable->api_data->firstname; return (new MailMessage()) ->subject(trans('Supression du compte - :site_name', [ - 'site_name' => config('theme.site_name') + 'site_name' => $settings->name ])) ->greeting(trans('Bonjour :first_name', ['first_name' => $first_name])) ->line(trans( @@ -42,7 +45,7 @@ class DestroyCustomer extends Notification Vous pourrez le réactiver durant ce délai si vous le souhaitez en vous reconnectant.", [ - 'site_name' => config('app.name') + 'site_name' => $settings->name ] )); } diff --git a/app/Notifications/Customer/DestroyedCustomer.php b/app/Notifications/Customer/DestroyedCustomer.php index 5415e27..5d5de4f 100644 --- a/app/Notifications/Customer/DestroyedCustomer.php +++ b/app/Notifications/Customer/DestroyedCustomer.php @@ -29,10 +29,13 @@ class DestroyedCustomer extends Notification */ public function toMail(object $notifiable): MailMessage { + /** @var \App\Models\Settings */ + $settings = app(Settings::class); + // phpcs:enable return (new MailMessage()) ->subject(trans('Votre compte est suprimé - :site_name', [ - 'site_name' => config('app.name') + 'site_name' => $settings->name ])) ->greeting('Bonjour') ->line(trans( @@ -40,7 +43,7 @@ class DestroyedCustomer extends Notification si vous aviez effectué une commande elle sera bien sûr toujours honorée. Les commandes associés a votre compte continueront d'exister mais les données de votre compte ont bien été supprimées.", [ - 'site_name' => config('app.name') + 'site_name' => $settings->name ] )); } diff --git a/app/Notifications/Customer/ResetPassword.php b/app/Notifications/Customer/ResetPassword.php index 5b0c4c4..54a317d 100644 --- a/app/Notifications/Customer/ResetPassword.php +++ b/app/Notifications/Customer/ResetPassword.php @@ -47,17 +47,20 @@ class ResetPassword extends NotificationsResetPassword public function toMail($notifiable) { // phpcs:enable + /** @var \App\Models\Settings */ + $settings = app(Settings::class); + /** @var \App\Models\Customer\Customer $notifiable */ $resetUrl = $this->resetUrl($notifiable); /** @var string $first_name */ $first_name = $notifiable->api_data->firstname; return (new MailMessage()) - ->subject(trans('Mot de passe oublié - :site_name', ['site_name' => config('app.name')])) + ->subject(trans('Mot de passe oublié - :site_name', ['site_name' => $settings->name])) ->greeting(trans('Bonjour :first_name', ['first_name' => $first_name])) ->line(trans( 'Afin réinitialiser votre mot de passe pour vous connecter à :site_name, cliquez sur le lien suivant :', - ['site_name' => config('app.name')] + ['site_name' => $settings->name] )) /** @var string $verificationUrl */ ->action(trans('Réinitialisez votre mot de passe'), $resetUrl); diff --git a/app/Notifications/Customer/UpdateEmail.php b/app/Notifications/Customer/UpdateEmail.php index 876a00e..6845782 100644 --- a/app/Notifications/Customer/UpdateEmail.php +++ b/app/Notifications/Customer/UpdateEmail.php @@ -28,16 +28,19 @@ class UpdateEmail extends Notification */ public function toMail(object $notifiable): MailMessage { + /** @var \App\Models\Settings */ + $settings = app(Settings::class); + /** @var string $first_name */ $first_name = $notifiable->api_data->firstname; return (new MailMessage()) ->subject(trans('Mise à jour de l\'email - :site_name', [ - 'site_name' => config('app.name') + 'site_name' => $settings->name ])) ->greeting(trans('Bonjour :first_name', ['first_name' => $first_name])) ->line(trans('L\'email associé à votre compte :site_name vient d\'être modifié.', [ - 'site_name' => config('app.name') + 'site_name' => $settings->name ])); } } diff --git a/app/Notifications/Customer/UpdatePassword.php b/app/Notifications/Customer/UpdatePassword.php index f3f076b..b382ef1 100644 --- a/app/Notifications/Customer/UpdatePassword.php +++ b/app/Notifications/Customer/UpdatePassword.php @@ -28,16 +28,19 @@ class UpdatePassword extends Notification */ public function toMail(object $notifiable): MailMessage { + /** @var \App\Models\Settings */ + $settings = app(Settings::class); + /** @var string $first_name */ $first_name = $notifiable->api_data->firstname; return (new MailMessage()) ->subject(trans('Mise à jour du mot de passe - :site_name', [ - 'site_name' => config('app.name') + 'site_name' => $settings->name ])) ->greeting(trans('Bonjour :first_name', ['first_name' => $first_name])) ->line(trans("Le mot de passe associé à votre compte :site_name vient d'être modifié.", [ - 'site_name' => config('app.name') + 'site_name' => $settings->name ])); } } diff --git a/app/Notifications/Customer/VerifyEmail.php b/app/Notifications/Customer/VerifyEmail.php index d24cbeb..e081bbd 100644 --- a/app/Notifications/Customer/VerifyEmail.php +++ b/app/Notifications/Customer/VerifyEmail.php @@ -47,6 +47,9 @@ class VerifyEmail extends NotificationsVerifyEmail public function toMail($notifiable) { // phpcs:enable + /** @var \App\Models\Settings */ + $settings = app(Settings::class); + /** @var \App\Models\Customer\Customer $notifiable */ /** @var string $verificationUrl */ $verificationUrl = $this->verificationUrl($notifiable); @@ -55,7 +58,7 @@ class VerifyEmail extends NotificationsVerifyEmail return (new MailMessage()) ->success() - ->subject(trans("Inscription - :site_name", ['site_name' => config('app.name')])) + ->subject(trans("Inscription - :site_name", ['site_name' => $settings->name])) ->greeting(trans('Bonjour :first_name', ['first_name' => $first_name])) ->line(trans('Vous n\'êtes plus qu\'à un clic de votre inscription... ')) ->line(trans('Pour finaliser votre inscription, merci de cliquer sur le lien ci-dessous :')) diff --git a/config/theme.php b/config/theme.php index d2be942..1b5f13f 100644 --- a/config/theme.php +++ b/config/theme.php @@ -2,13 +2,16 @@ return array_replace_recursive( [ - 'theme_name' => 'basic', - 'site_name' => 'Gen Game Web Basic', + 'theme_name' => 'base', 'models' => [ - 'product' => [ - 'picture_maxwidth' => 500, - 'picture_maxheight' => 500, - ] + 'products' => [ + 'picture_max_width' => 550, + 'picture_max_height' => 550, + ], + 'ranges' => [ + 'picture_max_width' => 476, + 'picture_max_height' => 355, + ], ], ], require(resource_path('theme/mounted/theme.config.php')), diff --git a/database/migrations/2020_10_12_123129_create_settings.php b/database/migrations/2020_10_12_123129_create_settings.php index 8068b36..958ad63 100644 --- a/database/migrations/2020_10_12_123129_create_settings.php +++ b/database/migrations/2020_10_12_123129_create_settings.php @@ -15,7 +15,8 @@ class CreateSettings extends Migration { Schema::create('settings', function (Blueprint $table) { $table->id(); - $table->string('name'); + $table->string('name')->comment('Nom du jeu'); + $table->string('company')->comment('Nom de la société qui organise le jeu'); $table->dateTime('start_date'); $table->dateTime('end_date'); $table->integer('nb_participation_player'); diff --git a/database/seeders/Mandatory/SettingsSeeder.php b/database/seeders/Mandatory/SettingsSeeder.php index b36d195..9f6299a 100644 --- a/database/seeders/Mandatory/SettingsSeeder.php +++ b/database/seeders/Mandatory/SettingsSeeder.php @@ -18,6 +18,7 @@ class SettingsSeeder extends Seeder DB::table('settings')->truncate(); $settings = new Settings(); $settings->name = 'Nom du jeu'; + $settings->company = 'Société'; $settings->start_date = now(); $settings->end_date = now()->addDays(30); $settings->nb_participation_player = 30; diff --git a/resources/views/layouts/head.blade.php b/resources/views/layouts/head.blade.php index 1aa5c70..61d238d 100644 --- a/resources/views/layouts/head.blade.php +++ b/resources/views/layouts/head.blade.php @@ -1,7 +1,7 @@ -{{ config('app.name') }} - @yield('title') +{{ $settingsGlobal->name }} - @yield('title') diff --git a/resources/views/layouts/header.blade.php b/resources/views/layouts/header.blade.php index 3288f62..5078b4a 100644 --- a/resources/views/layouts/header.blade.php +++ b/resources/views/layouts/header.blade.php @@ -2,7 +2,7 @@
- {{ config('app.name', 'Laravel') }} + {{ $settingsGlobal->name }} @auth('backend')
+ {{-- COMPANY --}} +
+
+ {{ Str::ucfirst(__('validation.custom.company')) }} +
+
+ @include('back::partials.inputs.varchar', [ + 'id' => 'settingsCompany', + 'label' => __('Nom de la :field qui organise le jeu', [ + 'field' => Str::ucfirst(__('validation.custom.company')), + ]), + 'hasWordCounter' => true, + 'name' => 'company', + 'required' => true, + 'model' => $settingsModel ?? null, + 'helper' => __('validation.between.string', [ + 'attribute' => __('Nom de la :field', [ + 'field' => Str::ucfirst(__('validation.custom.company')), + ]), + 'min' => 3, + 'max' => 255, + ]), + 'placeholder' => __(':field', [ + 'field' => Str::ucfirst(__('validation.custom.company')), + ]), + ]) +
+
+
+
{{-- START_DATE --}}
diff --git a/resources/views/vendor/errors/403.blade.php b/resources/views/vendor/errors/403.blade.php index de31d5c..7e326b5 100644 --- a/resources/views/vendor/errors/403.blade.php +++ b/resources/views/vendor/errors/403.blade.php @@ -8,5 +8,6 @@ @section('button', true) @section('image') - + @endsection diff --git a/resources/views/vendor/errors/404.blade.php b/resources/views/vendor/errors/404.blade.php index 02b2b13..b31fadb 100644 --- a/resources/views/vendor/errors/404.blade.php +++ b/resources/views/vendor/errors/404.blade.php @@ -8,5 +8,6 @@ @section('button', true) @section('image') - + @endsection diff --git a/resources/views/vendor/errors/503.blade.php b/resources/views/vendor/errors/503.blade.php index edf601f..ae9c7e2 100644 --- a/resources/views/vendor/errors/503.blade.php +++ b/resources/views/vendor/errors/503.blade.php @@ -6,5 +6,6 @@ @section('submessage', __('Le site est en maintenance, nous reviendrons...')) @section('image') - + @endsection diff --git a/resources/views/vendor/mail/html/header.blade.php b/resources/views/vendor/mail/html/header.blade.php index 6ee6fc4..48c7bf2 100644 --- a/resources/views/vendor/mail/html/header.blade.php +++ b/resources/views/vendor/mail/html/header.blade.php @@ -4,7 +4,8 @@ @if (trim($slot) === 'Laravel') @else - + {{ $slot }} @endif