Exception Handling is the process of catching errors and returning a proper response instead of crashing the application.
public function show($id)
{
try {
$user = User::findOrFail($id);
return $user;
} catch (\Exception $e) {
return "User Not Found";
}
}