abort_if()
can be used as shorter way to check condition and throw an error page.
1$product = Product::findOrFail($id);2if($product->user_id != auth()->user()->id){3 abort(403);4}
Shorter way
1/* abort_if(CONDITION, ERROR_CODE) */2$product = Product::findOrFail($id);3abort_if ($product->user_id != auth()->user()->id, 403)