Revert "refactor: 🔥 remove newsletter_email field from brands table"
This reverts commit 27d0c1fc21.
This commit is contained in:
parent
b04ca114ae
commit
8170bb395a
4 changed files with 57 additions and 4 deletions
|
|
@ -37,10 +37,11 @@ class StoreBrandRequest extends FormRequest
|
|||
public function rules(): array
|
||||
{
|
||||
$rules = [
|
||||
'name' => 'required|unique:brands,name|string|min:5|max:255',
|
||||
'url' => 'required|url|min:5|max:255',
|
||||
'url_claim' => 'required|url|min:5|max:255',
|
||||
'domain' => 'required|unique:brands,domain|string|min:5|max:255',
|
||||
'name' => 'required|unique:brands,name|string|min:5|max:255',
|
||||
'url' => 'required|url|min:5|max:255',
|
||||
'url_claim' => 'required|url|min:5|max:255',
|
||||
'domain' => 'required|unique:brands,domain|string|min:5|max:255',
|
||||
'newsletter_email' => 'nullable|email:rfc,strict,dns,spoof,filter',
|
||||
];
|
||||
return \array_merge(
|
||||
$rules,
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ class Brand extends Model
|
|||
'url',
|
||||
'url_claim',
|
||||
'domain',
|
||||
'newsletter_email',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
28
database/migrations/2026_04_03_152802_alter_brands_table.php
Normal file
28
database/migrations/2026_04_03_152802_alter_brands_table.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('brands', function (Blueprint $table) {
|
||||
$table->string('newsletter_email')->nullable()->comment('Brand associative newsletter email.')->after('domain');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('brands', function (Blueprint $table) {
|
||||
$table->dropColumn('newsletter_email');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -89,6 +89,29 @@
|
|||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- NEWSLETTER_EMAIL --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="h-100 border p-3">
|
||||
<legend>{{ str(__('validation.custom.newsletter_email'))->ucfirst() }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12 mb-3">
|
||||
@include('bo.partials.inputs.varchar', [
|
||||
'id' => 'brandNewsletterEmail',
|
||||
'label' => __(':field de la :model', [
|
||||
'field' => str(__('validation.custom.newsletter_email'))->ucfirst(),
|
||||
'model' => str(__('models.classes.brands'))->singular(),
|
||||
]),
|
||||
'hasWordCounter' => true,
|
||||
'name' => 'newsletter_email',
|
||||
'required' => false,
|
||||
'model' => $brandModel ?? null,
|
||||
'placeholder' => 'no-reply@example.com',
|
||||
'helper' => __('Adresse email utilisée pour l\'envoi de la newsletter.'),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- IMAGE --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="h-100 border p-3">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue