diff --git a/app/Http/Controllers/Bo/PostsController.php b/app/Http/Controllers/Bo/PostsController.php index 8b98737..db2452e 100644 --- a/app/Http/Controllers/Bo/PostsController.php +++ b/app/Http/Controllers/Bo/PostsController.php @@ -6,7 +6,6 @@ use App\Http\Controllers\Controller; use App\Http\Requests\StorePostRequest; use App\Http\Requests\UpdatePostRequest; use App\Models\Post; -use phpDocumentor\Reflection\Types\Boolean; class PostsController extends Controller { diff --git a/app/Http/Requests/StorePictoBrandRequest.php b/app/Http/Requests/StorePictoBrandRequest.php index 15ab675..e82bdd6 100644 --- a/app/Http/Requests/StorePictoBrandRequest.php +++ b/app/Http/Requests/StorePictoBrandRequest.php @@ -26,6 +26,7 @@ class StorePictoBrandRequest extends FormRequest return [ 'title' => 'required|max:50', 'picture' => 'sometimes|image|mimes:jpeg,png,jpg|max:512|dimensions:max_width=150,max_height=150', + 'alt_text_picture' => 'required|max:255', 'text' => 'required|max:127', ]; } diff --git a/app/Http/Requests/StorePictoRequest.php b/app/Http/Requests/StorePictoRequest.php index a23f0d4..0f721a6 100644 --- a/app/Http/Requests/StorePictoRequest.php +++ b/app/Http/Requests/StorePictoRequest.php @@ -25,6 +25,7 @@ class StorePictoRequest extends FormRequest { return [ 'picture' => 'sometimes|image|mimes:png|max:512|dimensions:max_width=150,max_height=150', + 'alt_text_picture' => 'required|max:255', 'text' => 'required|max:50', ]; } diff --git a/app/Http/Requests/StorePostRequest.php b/app/Http/Requests/StorePostRequest.php index e505d7a..4a5b20f 100644 --- a/app/Http/Requests/StorePostRequest.php +++ b/app/Http/Requests/StorePostRequest.php @@ -38,6 +38,7 @@ class StorePostRequest extends FormRequest { return [ 'picture_news' => 'required|image|mimes:jpeg,png,jpg|max:1024|dimensions:max_width=380,max_height=298', + 'alt_text_picture_news' => 'required|max:255', 'title' => 'required|max:255', 'text' => 'required|min:20', 'date_start' => [ @@ -53,6 +54,7 @@ class StorePostRequest extends FormRequest 'before:' . Carbon::now()->parse('2037-12-31') ], 'picture_home' => 'required|image|mimes:jpeg,png,jpg|max:2048|dimensions:max_width=1030,max_height=239', + 'alt_text_picture_home' => 'required|max:255', 'on_top' => 'nullable|boolean', ]; } diff --git a/app/Http/Requests/UpdateAdviceRequest.php b/app/Http/Requests/UpdateAdviceRequest.php index 71ce2a6..ee63d56 100644 --- a/app/Http/Requests/UpdateAdviceRequest.php +++ b/app/Http/Requests/UpdateAdviceRequest.php @@ -27,8 +27,11 @@ class UpdateAdviceRequest extends FormRequest 'title1' => 'required|max:50', 'title2' => 'required|max:50', 'picture1' => 'sometimes|image|mimes:jpeg,png,jpg|max:1024|dimensions:width=284,height=284', + 'alt_text_picture1' => 'required|max:255', 'picture2' => 'sometimes|image|mimes:jpeg,png,jpg|max:1024|dimensions:width=284,height=284', + 'alt_text_picture2' => 'required|max:255', 'picture3' => 'sometimes|image|mimes:jpeg,png,jpg|max:1024|dimensions:width=284,height=284', + 'alt_text_picture3' => 'required|max:255', 'text1' => 'required|max:2047', 'text2' => 'required|max:2047', ]; diff --git a/app/Http/Requests/UpdateEncartRequest.php b/app/Http/Requests/UpdateEncartRequest.php index 02fa849..10af8be 100644 --- a/app/Http/Requests/UpdateEncartRequest.php +++ b/app/Http/Requests/UpdateEncartRequest.php @@ -32,6 +32,7 @@ class UpdateEncartRequest extends FormRequest // ], 'text' => 'required|max:2047', 'picture' => 'sometimes|image|mimes:jpeg,png,jpg|max:2048', + 'alt_text_picture' => 'required|max:255', ]; } } diff --git a/app/Models/Advice.php b/app/Models/Advice.php index 52540e4..e0191aa 100644 --- a/app/Models/Advice.php +++ b/app/Models/Advice.php @@ -14,8 +14,11 @@ class Advice extends Model 'title1', 'title2', 'picture1', + 'alt_text_picture1', 'picture2', + 'alt_text_picture2', 'picture3', + 'alt_text_picture3', 'text1', 'text2', ]; diff --git a/app/Models/Encart.php b/app/Models/Encart.php index 0271a01..b9b238a 100644 --- a/app/Models/Encart.php +++ b/app/Models/Encart.php @@ -21,7 +21,8 @@ class Encart extends Model 'title', 'subtitle', 'text', - 'picture' + 'picture', + 'alt_text_picture', ]; protected static function boot() diff --git a/app/Models/Moment.php b/app/Models/Moment.php index 1bddce3..bfbcf78 100644 --- a/app/Models/Moment.php +++ b/app/Models/Moment.php @@ -22,6 +22,7 @@ class Moment extends Model 'subtitle', 'text', 'picture' + 'alt_text_picture', ]; protected static function boot() diff --git a/app/Models/Picto.php b/app/Models/Picto.php index aeb6083..e677ed0 100644 --- a/app/Models/Picto.php +++ b/app/Models/Picto.php @@ -19,6 +19,7 @@ class Picto extends Model protected $fillable = [ 'picture', + 'alt_text_picture', 'text', ]; diff --git a/app/Models/PictoBrand.php b/app/Models/PictoBrand.php index bea5f9b..b0d292c 100644 --- a/app/Models/PictoBrand.php +++ b/app/Models/PictoBrand.php @@ -13,6 +13,7 @@ class PictoBrand extends Model protected $fillable = [ 'title', 'picture', + 'alt_text_picture', 'text', ]; diff --git a/app/Models/Post.php b/app/Models/Post.php index 079e068..1ea1029 100644 --- a/app/Models/Post.php +++ b/app/Models/Post.php @@ -24,7 +24,9 @@ class Post extends Model 'title', 'text', 'picture_home', + 'alt_text_picture_home', 'picture_news', + 'alt_text_picture_news', 'date_start', 'date_end', 'on_top' diff --git a/database/factories/AdviceFactory.php b/database/factories/AdviceFactory.php index 3ac5924..840866e 100644 --- a/database/factories/AdviceFactory.php +++ b/database/factories/AdviceFactory.php @@ -27,8 +27,11 @@ class AdviceFactory extends Factory 'title1' => $this->faker->text(40), 'title2' => $this->faker->text(40), 'picture1' => new SplFileInfo(resource_path('assets/images/repas.jpg')), + 'alt_text_picture1' => $this->faker->sentence(10), 'picture2' => new SplFileInfo(resource_path('assets/images/repas.jpg')), + 'alt_text_picture2' => $this->faker->sentence(10), 'picture3' => new SplFileInfo(resource_path('assets/images/repas.jpg')), + 'alt_text_picture3' => $this->faker->sentence(10), 'text1' => $this->faker->paragraph(10), 'text2' => $this->faker->paragraph(10), ]; diff --git a/database/factories/EncartFactory.php b/database/factories/EncartFactory.php index 0c70509..186323c 100644 --- a/database/factories/EncartFactory.php +++ b/database/factories/EncartFactory.php @@ -27,7 +27,8 @@ class EncartFactory extends Factory 'title' => $this->faker->text(5), 'subtitle' => $this->faker->sentence(7, false), 'text' => $this->faker->paragraph(10, false), - 'picture' => new SplFileInfo(resource_path('assets/images/prez-img.jpg')) + 'picture' => new SplFileInfo(resource_path('assets/images/prez-img.jpg')), + 'alt_text_picture' => $this->faker->sentence(10), ]; } } diff --git a/database/factories/MomentFactory.php b/database/factories/MomentFactory.php index fe618d7..18137a6 100644 --- a/database/factories/MomentFactory.php +++ b/database/factories/MomentFactory.php @@ -27,7 +27,8 @@ class MomentFactory extends Factory 'title' => $this->faker->text(5), 'subtitle' => $this->faker->sentence(7, false), 'text' => $this->faker->paragraph(10, false), - 'picture' => new SplFileInfo(resource_path('assets/images/prez-img.jpg')) + 'picture' => new SplFileInfo(resource_path('assets/images/prez-img.jpg')), + 'alt_text_picture' => $this->faker->sentence(10), ]; } } diff --git a/database/factories/PictoBrandFactory.php b/database/factories/PictoBrandFactory.php index c61defc..0cd203b 100644 --- a/database/factories/PictoBrandFactory.php +++ b/database/factories/PictoBrandFactory.php @@ -26,6 +26,7 @@ class PictoBrandFactory extends Factory return [ 'title' => $this->faker->randomNumber(3, false), 'picture' => new SplFileInfo(resource_path('assets/images/site-production.jpg')), + 'alt_text_picture' => $this->faker->sentence(10), 'text' => $this->faker->text(20), ]; } diff --git a/database/factories/PictoFactory.php b/database/factories/PictoFactory.php index 6805e37..b53795d 100644 --- a/database/factories/PictoFactory.php +++ b/database/factories/PictoFactory.php @@ -24,6 +24,7 @@ class PictoFactory extends Factory { return [ 'picture' => new SplFileInfo(resource_path('assets/images/qualite.png')), + 'alt_text_picture' => $this->faker->sentence(10), 'text' => $this->faker->text(10), ]; } diff --git a/database/factories/PostFactory.php b/database/factories/PostFactory.php index 6f522d7..eddae23 100644 --- a/database/factories/PostFactory.php +++ b/database/factories/PostFactory.php @@ -19,7 +19,9 @@ class PostFactory extends Factory 'title' => $this->faker->text(5), 'text' => $this->faker->paragraph(10, false), 'picture_home' => new SplFileInfo(resource_path('assets/images/burger-fond.jpg')), + 'alt_text_picture_home' => $this->faker->sentence(10), 'picture_news' => new SplFileInfo(resource_path('assets/images/burger.jpg')), + 'alt_text_picture_news' => $this->faker->sentence(10), 'date_start' => Carbon::now(), 'date_end' => Carbon::now()->addDays(2), 'on_top' => false diff --git a/database/migrations/2021_04_14_115938_create_encarts_table.php b/database/migrations/2021_04_14_115938_create_encarts_table.php index 4e2bb74..385498e 100644 --- a/database/migrations/2021_04_14_115938_create_encarts_table.php +++ b/database/migrations/2021_04_14_115938_create_encarts_table.php @@ -20,6 +20,7 @@ class CreateEncartsTable extends Migration $table->string('subtitle'); $table->text('text'); $table->string('picture')->nullable(); + $table->string('alt_text_picture')->nullable(); $table->timestamps(); }); } diff --git a/database/migrations/2021_12_10_140929_create_pictos_table.php b/database/migrations/2021_12_10_140929_create_pictos_table.php index 8859781..8f5307b 100644 --- a/database/migrations/2021_12_10_140929_create_pictos_table.php +++ b/database/migrations/2021_12_10_140929_create_pictos_table.php @@ -17,6 +17,7 @@ class CreatePictosTable extends Migration $table->id(); $table->smallInteger('page'); $table->string('picture')->nullable(); + $table->string('alt_text_picture')->nullable(); $table->text('text'); $table->timestamps(); }); diff --git a/database/migrations/2021_12_10_143830_create_picto_brands_table.php b/database/migrations/2021_12_10_143830_create_picto_brands_table.php index 95c8193..9748428 100644 --- a/database/migrations/2021_12_10_143830_create_picto_brands_table.php +++ b/database/migrations/2021_12_10_143830_create_picto_brands_table.php @@ -17,6 +17,7 @@ class CreatePictoBrandsTable extends Migration $table->id(); $table->string('title'); $table->string('picture')->nullable(); + $table->string('alt_text_picture')->nullable(); $table->string('text'); $table->timestamps(); }); diff --git a/database/migrations/2021_12_16_093950_create_advice_table.php b/database/migrations/2021_12_16_093950_create_advice_table.php index 6c68dba..48fc7d2 100644 --- a/database/migrations/2021_12_16_093950_create_advice_table.php +++ b/database/migrations/2021_12_16_093950_create_advice_table.php @@ -18,8 +18,11 @@ class CreateAdviceTable extends Migration $table->string('title1'); $table->string('title2'); $table->string('picture1')->nullable(); + $table->string('alt_text_picture1')->nullable(); $table->string('picture2')->nullable(); + $table->string('alt_text_picture2')->nullable(); $table->string('picture3')->nullable(); + $table->string('alt_text_picture3')->nullable(); $table->text('text1'); $table->text('text2'); $table->timestamps(); diff --git a/database/migrations/2021_12_16_131639_create_posts_table.php b/database/migrations/2021_12_16_131639_create_posts_table.php index ec880f6..a085570 100644 --- a/database/migrations/2021_12_16_131639_create_posts_table.php +++ b/database/migrations/2021_12_16_131639_create_posts_table.php @@ -18,7 +18,9 @@ class CreatePostsTable extends Migration $table->string('title'); $table->mediumText('text'); $table->string('picture_home')->nullable(); + $table->string('alt_text_picture_home')->nullable(); $table->string('picture_news')->nullable(); + $table->string('alt_text_picture_news')->nullable(); $table->timestamp('date_start')->nullable(); $table->timestamp('date_end')->nullable(); $table->boolean('on_top')->default(false); diff --git a/database/seeders/PictosSeeder.php b/database/seeders/PictosSeeder.php index bbf2049..0c9c45a 100644 --- a/database/seeders/PictosSeeder.php +++ b/database/seeders/PictosSeeder.php @@ -26,6 +26,7 @@ class PictosSeeder extends Seeder $picto = new Picto(); $picto->page = $value; $picto->picture = new SplFileInfo(resource_path('assets/images/qualite.png')); + $picto->alt_text_picture = 'lorem ipsum set doloris at em gorbicus'; $picto->text = 'lorem ipsum set doloris'; $picto->save(); } diff --git a/resources/views/back/advice/edit.blade.php b/resources/views/back/advice/edit.blade.php index 74e5be4..401c6a6 100644 --- a/resources/views/back/advice/edit.blade.php +++ b/resources/views/back/advice/edit.blade.php @@ -25,6 +25,11 @@ @endif @include('back.modules.input-error', ['inputName'=>'picture1']) +
-
+
{{ $picto->title }}
{!! clean(nl2br($picto->text)) !!}
@@ -60,7 +60,7 @@{{ $encart_marqueBloc4l->text}}
{{ $encart_marqueBloc4r->text}}
{{ $encart_marqueFooter->text}}
@@ -54,13 +54,13 @@
+
diff --git a/resources/views/front/home.blade.php b/resources/views/front/home.blade.php
index 54813ec..74d9e1a 100644
--- a/resources/views/front/home.blade.php
+++ b/resources/views/front/home.blade.php
@@ -48,7 +48,7 @@
+
@if (isset($post_home))
@@ -97,7 +97,7 @@
{!! clean(nl2br($post_home->text)) !!}
diff --git a/resources/views/front/news.blade.php b/resources/views/front/news.blade.php index bf2d8b0..0882e05 100644 --- a/resources/views/front/news.blade.php +++ b/resources/views/front/news.blade.php @@ -6,7 +6,7 @@+ d'info ?
-
+
+
{!! clean(nl2br($post->text)) !!}
+