fix: 🐛 remove required on product picture + change search filed on product in bo
This commit is contained in:
parent
1966e8ed02
commit
c8a1af5833
5 changed files with 38 additions and 21 deletions
|
|
@ -54,18 +54,10 @@ class ProductController extends Controller
|
|||
$search,
|
||||
null,
|
||||
'label',
|
||||
'description',
|
||||
'details',
|
||||
'preparation',
|
||||
'ingredients',
|
||||
);
|
||||
}
|
||||
$searchFields = \implode(', ', [
|
||||
trans('validation.custom.label'),
|
||||
trans('validation.attributes.description'),
|
||||
trans('validation.custom.details'),
|
||||
trans('validation.custom.preparation'),
|
||||
str(trans('validation.custom.ingredient'))->plural()->value(),
|
||||
trans('validation.custom.label')
|
||||
]);
|
||||
|
||||
/** Sort columns with a query */
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ class StoreProductRequest extends FormRequest
|
|||
];
|
||||
return \array_merge(
|
||||
$rules,
|
||||
$this->pictureRules('picture', 300, 200, 300, 200),
|
||||
$this->pictureRules('picture', 300, 200, 300, 200, true),
|
||||
$this->pictureRules('banner', 1440, 420, 1440, 420, true),
|
||||
$this->pictureRules('packaging', 315, 450, 315, 450),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->string('picture')->nullable()->change();
|
||||
$table->string('picture_alt')->nullable()->change();
|
||||
$table->string('picture_title')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('products', function (Blueprint $table) {
|
||||
$table->string('picture')->nullable(false)->change();
|
||||
$table->string('picture_alt')->nullable(false)->change();
|
||||
$table->string('picture_title')->nullable(false)->change();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -246,7 +246,6 @@
|
|||
]),
|
||||
'hasWordCounter' => true,
|
||||
'name' => 'picture_alt',
|
||||
'required' => true,
|
||||
'model' => $productModel ?? null,
|
||||
'helper' => __('crud.minicrud.picture_alt_helper'),
|
||||
'placeholder' => __(':field1 :inter1:field2 :inter2:model', [
|
||||
|
|
@ -271,7 +270,6 @@
|
|||
]),
|
||||
'hasWordCounter' => true,
|
||||
'name' => 'picture_title',
|
||||
'required' => true,
|
||||
'model' => $productModel ?? null,
|
||||
'helper' => __('crud.minicrud.picture_title_helper'),
|
||||
'placeholder' => __(':field1 :inter1:field2 :inter2:model', [
|
||||
|
|
@ -291,7 +289,6 @@
|
|||
'width' => 300,
|
||||
'height' => 200,
|
||||
'model' => $productModel ?? null,
|
||||
'required' => true,
|
||||
'preview' => true,
|
||||
])
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@
|
|||
$commitmentItem1->picture = 'resources/assets/images/commitments/commitment-1/preview-banner.jpg';
|
||||
$commitmentItem1->picture_alt = __('Homme portant un bébé dinde');
|
||||
$commitmentItem1->picture_title = __('Image de prévisualisation de la page Le métier d\'éleveur de volailles');
|
||||
// TODO
|
||||
// Put the good url
|
||||
$commitmentItem1->link = route('fo.breeding.show', $breedingPages->where('type', \App\Enums\StaticPageType::breedingJob)->first());
|
||||
// Item 2
|
||||
$commitmentItem2 = new stdClass();
|
||||
|
|
@ -14,8 +12,6 @@
|
|||
$commitmentItem2->picture = 'resources/assets/images/commitments/commitment-2/preview-banner.jpg';
|
||||
$commitmentItem2->picture_alt = __('Bébé dindes picorant');
|
||||
$commitmentItem2->picture_title = __('Image de prévisualisation de la bannière de la page alimentation des volailles');
|
||||
// TODO
|
||||
// Put the good url
|
||||
$commitmentItem2->link = route('fo.breeding.show', $breedingPages->where('type', \App\Enums\StaticPageType::breedingFood)->first());
|
||||
// Item 3
|
||||
$commitmentItem3 = new stdClass();
|
||||
|
|
@ -23,8 +19,6 @@
|
|||
$commitmentItem3->picture = 'resources/assets/images/commitments/commitment-3/preview-banner.jpg';
|
||||
$commitmentItem3->picture_alt = __('Éleveur portant une poule blanche');
|
||||
$commitmentItem3->picture_title = __('Image de prévisualisation de la bannière de la page santé des volailles');
|
||||
// TODO
|
||||
// Put the good url
|
||||
$commitmentItem3->link = route('fo.breeding.show', $breedingPages->where('type', \App\Enums\StaticPageType::breedingHealth)->first());
|
||||
|
||||
// Item 4
|
||||
|
|
@ -33,8 +27,6 @@
|
|||
$commitmentItem4->picture = 'resources/assets/images/commitments/commitment-4/preview-banner.jpg';
|
||||
$commitmentItem4->picture_alt = __('Groupe de poules couchées dans leur poulailler');
|
||||
$commitmentItem4->picture_title = __('Image de prévisualisation de la bannière de la page élevage des volailles.');
|
||||
// TODO
|
||||
// Put the good url
|
||||
$commitmentItem4->link = route('fo.breeding.show', $breedingPages->where('type', \App\Enums\StaticPageType::breedingPoultry)->first());
|
||||
|
||||
// All
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue