I am using laravel throw_unless in my code. It works fine in local PC, but in production server it always throw "Server Error".
throw_unless($product->unit_price > 1, OutOfStockException::class,'Product out of stock!');
and exception class:
class OutOfStockException extends Exception
{
public function __construct($message = "")
{
parent::__construct($message);
}
public function report() {
\Log::debug('Product out of stock');
}
}