Mejoras en la api

This commit is contained in:
2021-06-16 03:40:12 -04:00
parent 10f464eced
commit 64c05456af
10 changed files with 160 additions and 221 deletions

View File

@@ -0,0 +1,25 @@
<?php
namespace App\Exceptions;
use Exception;
class GenericException extends Exception {
protected $error;
protected $message;
protected $status;
public function __construct($error, $message, $status) {
$this->error = $error;
$this->message = $message;
$this->status = $status;
}
public function render($request) {
return response()->json([
'error' => $this->error
'message' => $this->message
], $status);
}
}