[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: Response.php
<?php namespace Illuminate\Auth\Access; use Illuminate\Contracts\Support\Arrayable; use Stringable; class Response implements Arrayable, Stringable { /** * Indicates whether the response was allowed. * * @var bool */ protected $allowed; /** * The response message. * * @var string|null */ protected $message; /** * The response code. * * @var mixed */ protected $code; /** * The HTTP response status code. * * @var int|null */ protected $status; /** * Create a new response. * * @param bool $allowed * @param string|null $message * @param mixed $code * @return void */ public function __construct($allowed, $message = '', $code = null) { $this->code = $code; $this->allowed = $allowed; $this->message = $message; } /** * Create a new "allow" Response. * * @param string|null $message * @param mixed $code * @return \Illuminate\Auth\Access\Response */ public static function allow($message = null, $code = null) { return new static(true, $message, $code); } /** * Create a new "deny" Response. * * @param string|null $message * @param mixed $code * @return \Illuminate\Auth\Access\Response */ public static function deny($message = null, $code = null) { return new static(false, $message, $code); } /** * Create a new "deny" Response with a HTTP status code. * * @param int $status * @param string|null $message * @param mixed $code * @return \Illuminate\Auth\Access\Response */ public static function denyWithStatus($status, $message = null, $code = null) { return static::deny($message, $code)->withStatus($status); } /** * Create a new "deny" Response with a 404 HTTP status code. * * @param string|null $message * @param mixed $code * @return \Illuminate\Auth\Access\Response */ public static function denyAsNotFound($message = null, $code = null) { return static::denyWithStatus(404, $message, $code); } /** * Determine if the response was allowed. * * @return bool */ public function allowed() { return $this->allowed; } /** * Determine if the response was denied. * * @return bool */ public function denied() { return ! $this->allowed(); } /** * Get the response message. * * @return string|null */ public function message() { return $this->message; } /** * Get the response code / reason. * * @return mixed */ public function code() { return $this->code; } /** * Throw authorization exception if response was denied. * * @return \Illuminate\Auth\Access\Response * * @throws \Illuminate\Auth\Access\AuthorizationException */ public function authorize() { if ($this->denied()) { throw (new AuthorizationException($this->message(), $this->code())) ->setResponse($this) ->withStatus($this->status); } return $this; } /** * Set the HTTP response status code. * * @param null|int $status * @return $this */ public function withStatus($status) { $this->status = $status; return $this; } /** * Set the HTTP response status code to 404. * * @return $this */ public function asNotFound() { return $this->withStatus(404); } /** * Get the HTTP status code. * * @return int|null */ public function status() { return $this->status; } /** * Convert the response to an array. * * @return array */ public function toArray() { return [ 'allowed' => $this->allowed(), 'message' => $this->message(), 'code' => $this->code(), ]; } /** * Get the string representation of the message. * * @return string */ public function __toString() { return (string) $this->message(); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.4 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002