Skip to content

Commit

Permalink
add validation for previwe image
Browse files Browse the repository at this point in the history
  • Loading branch information
gheorghelupu17 committed Oct 16, 2023
1 parent d9a6408 commit fd58f34
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Dashboard/ProjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
[
Expand Down
1 change: 1 addition & 0 deletions lang/ro/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,5 +222,6 @@
'target_budget' => 'Bugetul țintă',
'categories' => 'Categorii',
'counties' => 'Județe',
'preview' => 'Imaginea principala'
],
];
2 changes: 1 addition & 1 deletion resources/js/Pages/AdminOng/Projects/EditProject.vue
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
</Field>

<!-- Edit main image -->
<Field :label="$t('main_image')" :hasPendingChanges="changes.includes('cover_image')" :errors="formChangeStatus.errors.image">
<Field :label="$t('main_image')" :errors="formChangeStatus.errors.preview">
<template #value>
<div class="flex items-center col-span-12 gap-6 text-base font-medium leading-6 text-gray-700">
<img class="object-contain w-32 h-32 shrink-0" :src="originalProject.image" alt="" />
Expand Down

0 comments on commit fd58f34

Please sign in to comment.