create notification controller
This commit is contained in:
26
app/Exceptions/ProhibitedAction.php
Normal file
26
app/Exceptions/ProhibitedAction.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use App\Http\Traits\ApiResponse;
|
||||
use Exception;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Throwable;
|
||||
|
||||
class ProhibitedAction extends Exception
|
||||
{
|
||||
use ApiResponse;
|
||||
|
||||
public function __construct(public $message = "", int $code = 422, ?Throwable $previous = null)
|
||||
{
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the exception into an HTTP response.
|
||||
*/
|
||||
public function render(): JsonResponse
|
||||
{
|
||||
return $this->errorResponse($this->message);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user