From fd58f34db707929c360e355b5058f1ec8aef3218 Mon Sep 17 00:00:00 2001 From: Lupu Gheorghe Date: Mon, 16 Oct 2023 14:16:02 +0300 Subject: [PATCH] add validation for previwe image --- app/Http/Controllers/Dashboard/ProjectController.php | 2 +- lang/ro/validation.php | 1 + resources/js/Pages/AdminOng/Projects/EditProject.vue | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Dashboard/ProjectController.php b/app/Http/Controllers/Dashboard/ProjectController.php index 89145685..dfe5e4e2 100644 --- a/app/Http/Controllers/Dashboard/ProjectController.php +++ b/app/Http/Controllers/Dashboard/ProjectController.php @@ -101,7 +101,7 @@ public function changeStatus($id, Request $request) { $project = Project::findOrFail($id); $projectArray = $project->toArray(); - $projectArray['preview'] = $project->getFirstMediaUrl('preview') ?? null; + $projectArray['preview'] = $project->getFirstMedia('preview'); Validator::make( $projectArray, [ diff --git a/lang/ro/validation.php b/lang/ro/validation.php index 4c6b3afc..0aa82794 100644 --- a/lang/ro/validation.php +++ b/lang/ro/validation.php @@ -222,5 +222,6 @@ 'target_budget' => 'Bugetul țintă', 'categories' => 'Categorii', 'counties' => 'Județe', + 'preview' => 'Imaginea principala' ], ]; diff --git a/resources/js/Pages/AdminOng/Projects/EditProject.vue b/resources/js/Pages/AdminOng/Projects/EditProject.vue index 7f36e9b6..22dc78fd 100644 --- a/resources/js/Pages/AdminOng/Projects/EditProject.vue +++ b/resources/js/Pages/AdminOng/Projects/EditProject.vue @@ -261,7 +261,7 @@ - +