Answers for "throw exeption class laravel"

PHP
2

throwexception laravel

throw new \ErrorException('Error found');
Posted by: Guest on July-30-2021
0

laravel throw exception with status code

try {
    throw new Exception("Some error message", 30);
  //here 30 is the custom code
} catch(Exception $e) {
    echo "The exception code is: " . $e->getCode();
}
Posted by: Guest on February-09-2022

Browse Popular Code Answers by Language