You should move the not found logic to the controller and there you can set the statuscode for the view.
public function show(DealerSubsite $dealer, $entity_slug, $entity_id) {
$statusCode = 200;
// do something to decide if it is found or not
if (!$found) {
$statusCode = 404;
}
return response()->view('pages.subsites.inventories.show', compact('dealer', 'entity_id'), $statusCode);
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community