ThrowException Laravel
throw new \ErrorException('Error found');
prem@web_dev
throw new \ErrorException('Error found');
try {
throw new Exception("Some error message", 30);
//here 30 is the custom code
} catch(Exception $e) {
echo "The exception code is: " . $e->getCode();
}
php artisan make:exception UserNotFoundException