I would rewrite some parts of your code.
You can leverage of implicite model binding, so you don't need to try finding the model, it's done automatically.
public function update(StoreProductRequest $request, Product $product)
If the model isn't found, the ModelNotFoundException exception is triggered automatically. You can catch the Illuminate\Database\Eloquent\ModelNotFoundException exception and display a custom error view.
https://laravel.com/docs/12.x/errors#rendering-exceptions
If a validation fails in you form request, Laravel redirects automatically to the previous url ->back() with an error bag.
Add a gate to check if the authenticated is authorized to update the product.
Use $request->validated() instead of $request->only(). This way, if a data validation fails, you cannot save this data.
public function update(StoreProductRequest $request, Product $product)
{
Gate::authorize('update', $product);
$product->update($request->validated([
'name',
'category_id',
'author',
'price',
'discounted_price',
'description',
]));
return redirect('products.show', compact('product')->with('success', 'تم تعديل المنتج بنجاح');
}