Dingo\Api\Http\Response\Factory::errorUnauthorized PHP Method

errorUnauthorized() public method

Return a 401 unauthorized error.
public errorUnauthorized ( string $message = 'Unauthorized' ) : void
$message string
return void
    public function errorUnauthorized($message = 'Unauthorized')
    {
        $this->error($message, 401);
    }

Usage Example

Example #1
0
 /**
  * Return a 401 unauthorized error.
  *
  * @param string $message
  * @throws \Symfony\Component\HttpKernel\Exception\HttpException
  * @return void 
  * @static 
  */
 public static function errorUnauthorized($message = 'Unauthorized')
 {
     \Dingo\Api\Http\Response\Factory::errorUnauthorized($message);
 }