Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Nov 2, 2023
1 parent e95f2db commit d65b6fe
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Resources/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,21 @@ public function paginate(Request $request): LengthAwarePaginator
});
}

/**
* Handle the request.
*/
public function handleFormRequest(Request $request, Model $model): void
{
$this->validateFormRequest($request, $model);

$this->resolveFields($request)
->authorized($request, $model)
->visible($request->method() === 'POST' ? 'create' : 'update')
->persist($request, $model);

$model->save();
}

/**
* Register the routes.
*/
Expand Down

0 comments on commit d65b6fe

Please sign in to comment.