Skip to content

Commit

Permalink
fix project arrays when is null
Browse files Browse the repository at this point in the history
  • Loading branch information
gheorghelupu17 committed Oct 20, 2023
1 parent c42a39a commit 69bcc7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Http/Resources/Project/EditProjectResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public function toArray(Request $request): array
'reason_to_donate' => $this->reason_to_donate ?? '',
'accepting_volunteers' => $this->accepting_volunteers ? __('field.boolean.true') : __('field.boolean.false'),
'accepting_comments' => $this->accepting_comments ? __('field.boolean.true') : __('field.boolean.false'),
'videos' => $this->videos,
'external_links' => $this->external_links,
'videos' => empty($this->videos) ? [] : $this->videos,
'external_links' => empty($this->external_links) ? [] : $this->external_links,
'counties' => $this->counties->pluck('id')->toArray(),
'counties_names' => $this->counties->pluck('name')->join(', '),
'categories' => $this->categories->pluck('id')->toArray(),
Expand Down

0 comments on commit 69bcc7a

Please sign in to comment.