Skip to content

Commit

Permalink
Fix tags input for real submitting
Browse files Browse the repository at this point in the history
  • Loading branch information
techenby committed May 14, 2024
1 parent aebdf36 commit f025534
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/TrickController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function index()
public function create()
{
return view('tricks.create', [
'tagOptions' => Tag::all()->map(fn ($tag) => ['value' => $tag->id, 'label' => $tag->name])->toArray(),
'tagOptions' => Tag::all()->map(fn ($tag) => ['value' => $tag->name, 'label' => $tag->name])->toArray(),
]);
}

Expand Down
2 changes: 1 addition & 1 deletion resources/views/tricks/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<div>
<x-form.label for="tags" :value="__('Tags')" required />
<x-form.tags id="tags" class="block mt-1 w-full" name="tags" :options="$tagOptions" :value="old('tags')" />
<x-form.tags id="tags" class="block mt-1 w-full" name="tags[]" :options="$tagOptions" :value="old('tags')" />
<x-form.error :messages="$errors->get('tags')" class="mt-2" />
</div>

Expand Down

0 comments on commit f025534

Please sign in to comment.