You can use the fill method to set the attributes of the model before saving it. This way you can conditionally set the image_path attribute if the request has a file.
public function store(PostStoreRequest $request): RedirectResponse
{
$post = new Post();
$post->fill($request->validated());
if ($request->hasFile('image') {
$path = // do the upload thing here
$post->image_path = $path;
}
$post->save()
return redirect(route('posts.show', $post));
}