Update SlideFactory to set image URL to null, modify SlideResource to make image field optional, and adjust Slider components to display a default image when no URL is provided

This commit is contained in:
F4ilji
2025-08-12 14:50:23 +05:00
parent 06c23edad9
commit 478be2e212
4 changed files with 4 additions and 5 deletions
@@ -23,7 +23,7 @@ class SlideFactory extends Factory
'title' => $this->faker->sentence(3),
'content' => $this->faker->paragraph(2),
'image' => json_encode([
'url' => '/public/img/thumbnail-1.png',
'url' => null,
'shading' => $this->faker->randomFloat(1, 0, 1)
]),
'link' => '/news/' . $this->faker->slug,
+1 -2
View File
@@ -146,8 +146,7 @@ class SlideResource extends Resource
->resize(50)
->disk('public')
->directory('images')
->imageEditor()
->required(),
->imageEditor(),
ToggleButtons::make('image.shading')->inline()->grouped()->label('Уровень затемнения изображения')->options([
'1' => 'Без затемнения',
'0.7' => 'Слабое затемнение',