update code
This commit is contained in:
29
app/Exceptions/UserIdIncorrectFormat.php
Normal file
29
app/Exceptions/UserIdIncorrectFormat.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use Prettus\Repository\Traits\Respondable;
|
||||
use App\Entities\User;
|
||||
|
||||
class UserIdIncorrectFormat extends Exception
|
||||
{
|
||||
use Respondable;
|
||||
|
||||
protected $user;
|
||||
|
||||
public function __construct(User $user){
|
||||
$this->user = $user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the exception into an HTTP response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function render($request)
|
||||
{
|
||||
return $this->respondError("Mã người dùng " . $this->user->id . " không đúng định dạng.", 500);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user