Skip to content

Commit

Permalink
files-field vue component
Browse files Browse the repository at this point in the history
  • Loading branch information
sdebacker committed Aug 5, 2020
1 parent 0814dbc commit fc91756
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/Http/Controllers/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@ public function edit(Place $place): View

public function store(FormRequest $request): RedirectResponse
{
$model = Place::create($request->all());
$data = $request->except('file_ids');
$model = Place::create($data);

return $this->redirect($request, $model);
}

public function update(Place $place, FormRequest $request): RedirectResponse
{
$place->update($request->all());
$data = $request->except('file_ids');
$place->update($data);

return $this->redirect($request, $place);
}
Expand Down
2 changes: 1 addition & 1 deletion src/resources/views/admin/_form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<file-manager related-table="{{ $model->getTable() }}" :related-id="{{ $model->id ?? 0 }}"></file-manager>
<file-field type="image" field="image_id" data="{{ $model->image }}"></file-field>
<files-field related-table="{{ $model->getTable() }}" :related-id="{{ $model->id ?? 0 }}"></files-field>
<files-field :init-files="{{ $model->files }}"></files-field>

<ul class="nav nav-tabs">
<li class="nav-item">
Expand Down

0 comments on commit fc91756

Please sign in to comment.