prefix stringlengths 512 512 | suffix stringlengths 256 256 | middle stringlengths 14 229 | meta dict |
|---|---|---|---|
pace Illuminate\Cache;
class MemcachedLock extends Lock
{
/**
* The Memcached instance.
*
* @var \Memcached
*/
protected $memcached;
/**
* Create a new lock instance.
*
* @param \Memcached $memcached
* @param string $name
* @param int $seconds
* @par... |
);
}
/**
* Release the lock.
*
* @return bool
*/
public function release()
{
if ($this->isOwnedByCurrentProcess()) {
return $this->memcached->delete($this->name);
}
return f | d = $memcached;
}
/**
* Attempt to acquire the lock.
*
* @return bool
*/
public function acquire()
{
return $this->memcached->add(
$this->name, $this->owner, $this->seconds | {
"filepath": "src/Illuminate/Cache/MemcachedLock.php",
"language": "php",
"file_size": 1433,
"cut_index": 524,
"middle_length": 229
} |
izedStore implements CanFlushLocks, LockProvider, Store
{
/**
* The memoized cache values.
*
* @var array<string, mixed>
*/
protected $cache = [];
/**
* Create a new memoized cache instance.
*
* @param string $name
* @param \Illuminate\Cache\Repository $repositor... | fixedKey];
}
return $this->cache[$prefixedKey] = $this->repository->get($key);
}
/**
* Retrieve multiple items from the cache by key.
*
* Items not found in the cache will have a null value.
*
* @return ar | * @param string $key
* @return mixed
*/
public function get($key)
{
$prefixedKey = $this->prefix($key);
if (array_key_exists($prefixedKey, $this->cache)) {
return $this->cache[$pre | {
"filepath": "src/Illuminate/Cache/MemoizedStore.php",
"language": "php",
"file_size": 6798,
"cut_index": 716,
"middle_length": 229
} |
Contracts\Cache\CanFlushLocks;
use Illuminate\Contracts\Cache\LockProvider;
class NullStore extends TaggableStore implements CanFlushLocks, LockProvider
{
use RetrievesMultipleKeys;
/**
* Retrieve an item from the cache by key.
*
* @param string $key
* @return void
*/
public fun... | aram mixed $value
* @return false
*/
public function increment($key, $value = 1)
{
return false;
}
/**
* Decrement the value of an item in the cache.
*
* @param string $key
* @param mixed $value
| int $seconds
* @return bool
*/
public function put($key, $value, $seconds)
{
return false;
}
/**
* Increment the value of an item in the cache.
*
* @param string $key
* @p | {
"filepath": "src/Illuminate/Cache/NullStore.php",
"language": "php",
"file_size": 2994,
"cut_index": 563,
"middle_length": 229
} |
ate\Cache;
use Illuminate\Redis\Connections\PhpRedisConnection;
class PhpRedisLock extends RedisLock
{
/**
* Create a new phpredis lock instance.
*
* @param \Illuminate\Redis\Connections\PhpRedisConnection $redis
* @param string $name
* @param int $seconds
* @param string|null... | /**
* {@inheritDoc}
*/
public function release()
{
return (bool) $this->redis->eval(
LuaScripts::releaseLock(),
1,
$this->name,
...$this->redis->pack([$this->owner])
);
} | );
}
| {
"filepath": "src/Illuminate/Cache/PhpRedisLock.php",
"language": "php",
"file_size": 809,
"cut_index": 536,
"middle_length": 14
} |
ate\Support\LazyCollection;
use Illuminate\Support\Str;
use RuntimeException;
class RedisStore extends TaggableStore implements CanFlushLocks, LockProvider
{
use RetrievesMultipleKeys {
many as private manyAlias;
putMany as private putManyAlias;
}
/**
* The Redis factory implementatio... |
*
* @var string
*/
protected $lockConnection;
/**
* The classes that should be allowed during unserialization.
*
* @var array|bool|null
*/
protected $serializableClasses;
/**
* Create a new Redis s | ed $prefix;
/**
* The Redis connection instance that should be used to manage locks.
*
* @var string
*/
protected $connection;
/**
* The name of the connection that should be used for locks. | {
"filepath": "src/Illuminate/Cache/RedisStore.php",
"language": "php",
"file_size": 15085,
"cut_index": 921,
"middle_length": 229
} |
t\Facades\Validator;
use Illuminate\Support\Traits\Conditionable;
use InvalidArgumentException;
use IteratorAggregate;
use Traversable;
class Password implements DataAwareRule, ImplicitRule, IteratorAggregate, Rule, ValidatorAwareRule
{
use Conditionable;
/**
* The validator performing the validation.
... | assword is required.
*
* @var bool
*/
protected $required = false;
/**
* If the password should only be validated when present.
*
* @var bool
*/
protected $sometimes = false;
/**
* If the password r | /**
* The minimum size of the password.
*
* @var int
*/
protected $min = 8;
/**
* The maximum size of the password.
*
* @var int
*/
protected $max;
/**
* If the p | {
"filepath": "src/Illuminate/Validation/Rules/Password.php",
"language": "php",
"file_size": 11280,
"cut_index": 921,
"middle_length": 229
} |
namespace Illuminate\Validation\Rules;
use Closure;
use InvalidArgumentException;
use Stringable;
class RequiredIf implements Stringable
{
/**
* The condition that validates the attribute.
*
* @var (\Closure(): bool)|bool
*/
public $condition;
/**
* Create a new required validat... | ow new InvalidArgumentException('The provided condition must be a callable or boolean.');
}
}
/**
* Convert the rule to a validation string.
*
* @return string
*/
public function __toString()
{
if (is_ca | )
{
if (is_null($condition)) {
$condition = false;
}
if ($condition instanceof Closure || is_bool($condition)) {
$this->condition = $condition;
} else {
thr | {
"filepath": "src/Illuminate/Validation/Rules/RequiredIf.php",
"language": "php",
"file_size": 1172,
"cut_index": 518,
"middle_length": 229
} |
ts\Conditionable;
use Stringable;
class StringRule implements Stringable
{
use Conditionable;
/**
* The constraints for the string rule.
*/
protected array $constraints = ['string'];
/**
* The field under validation must be entirely alphabetic characters.
*
* @param bool $a... | $this->addRule($ascii ? 'alpha_dash:ascii' : 'alpha_dash');
}
/**
* The field under validation must be entirely alpha-numeric characters.
*
* @param bool $ascii
* @return $this
*/
public function alphaNumeric(bool $a | under validation must be entirely alpha-numeric characters, dashes, and underscores.
*
* @param bool $ascii
* @return $this
*/
public function alphaDash(bool $ascii = false): static
{
return | {
"filepath": "src/Illuminate/Validation/Rules/StringRule.php",
"language": "php",
"file_size": 4469,
"cut_index": 614,
"middle_length": 229
} |
ys;
/**
* The APC wrapper instance.
*
* @var \Illuminate\Cache\ApcWrapper
*/
protected $apc;
/**
* A string that should be prepended to keys.
*
* @var string
*/
protected $prefix;
/**
* Create a new APC store.
*
* @param \Illuminate\Cache\Ap... | ore an item in the cache for a given number of seconds.
*
* @param string $key
* @param mixed $value
* @param int $seconds
* @return bool
*/
public function put($key, $value, $seconds)
{
return $this->apc | /**
* Retrieve an item from the cache by key.
*
* @param string $key
* @return mixed
*/
public function get($key)
{
return $this->apc->get($this->prefix.$key);
}
/**
* St | {
"filepath": "src/Illuminate/Cache/ApcStore.php",
"language": "php",
"file_size": 3076,
"cut_index": 614,
"middle_length": 229
} |
Support\Carbon;
class ArrayLock extends Lock
{
/**
* The parent array cache store.
*
* @var \Illuminate\Cache\ArrayStore
*/
protected $store;
/**
* Create a new lock instance.
*
* @param \Illuminate\Cache\ArrayStore $store
* @param string $name
* @param in... | ow()->addSecond();
if ($this->exists() && $expiration->isFuture()) {
return false;
}
$this->store->locks[$this->name] = [
'owner' => $this->owner,
'expiresAt' => $this->seconds === 0 ? null : Ca | $this->store = $store;
}
/**
* Attempt to acquire the lock.
*
* @return bool
*/
public function acquire()
{
$expiration = $this->store->locks[$this->name]['expiresAt'] ?? Carbon::n | {
"filepath": "src/Illuminate/Cache/ArrayLock.php",
"language": "php",
"file_size": 2132,
"cut_index": 563,
"middle_length": 229
} |
port\InteractsWithTime;
use RuntimeException;
class ArrayStore extends TaggableStore implements CanFlushLocks, LockProvider
{
use InteractsWithTime, RetrievesMultipleKeys;
/**
* The array of stored values.
*
* @var array<string, array{value: mixed, expiresAt: float}>
*/
protected $stor... | */
protected $serializableClasses;
/**
* Create a new Array store.
*
* @param bool $serializesValues
* @param array|bool|null $serializableClasses
*/
public function __construct($serializesValues = false, $serial | dicates if values are serialized within the store.
*
* @var bool
*/
protected $serializesValues;
/**
* The classes that should be allowed during unserialization.
*
* @var array|bool|null
| {
"filepath": "src/Illuminate/Cache/ArrayStore.php",
"language": "php",
"file_size": 7409,
"cut_index": 716,
"middle_length": 229
} |
nException;
use RuntimeException;
use function Illuminate\Support\enum_value;
/**
* @mixin \Illuminate\Cache\Repository
* @mixin \Illuminate\Contracts\Cache\LockProvider
*/
class CacheManager implements FactoryContract
{
use RebindsCallbacksToSelf;
/**
* The application instance.
*
* @var \... | ication $app
*/
public function __construct($app)
{
$this->app = $app;
}
/**
* Get a cache store instance by name, wrapped in a repository.
*
* @param \UnitEnum|string|null $name
* @return \Illuminate\Co | *
* The registered custom driver creators.
*
* @var array
*/
protected $customCreators = [];
/**
* Create a new Cache manager instance.
*
* @param \Illuminate\Contracts\Foundation\Appl | {
"filepath": "src/Illuminate/Cache/CacheManager.php",
"language": "php",
"file_size": 15896,
"cut_index": 921,
"middle_length": 229
} |
sConcurrencyErrors;
use Illuminate\Database\QueryException;
use Throwable;
class DatabaseLock extends Lock
{
use DetectsConcurrencyErrors;
/**
* The database connection instance.
*
* @var \Illuminate\Database\Connection
*/
protected $connection;
/**
* The database table name.... | nection
* @param string $table
* @param string $name
* @param int $seconds
* @param string|null $owner
* @param array{int, int}|null $lottery
* @param int $defaultTimeoutInSeconds
*/
public function __cons | default number of seconds that a lock should be held.
*
* @var int
*/
protected $defaultTimeoutInSeconds;
/**
* Create a new lock instance.
*
* @param \Illuminate\Database\Connection $con | {
"filepath": "src/Illuminate/Cache/DatabaseLock.php",
"language": "php",
"file_size": 4680,
"cut_index": 614,
"middle_length": 229
} |
ements LockProvider, Store
{
use InteractsWithTime;
/**
* A string that should be prepended to keys.
*
* @var string
*/
protected $prefix;
/**
* The classes that should be allowed during unserialization.
*
* @var array|bool|null
*/
protected $serializableCla... | name of the attribute that should hold the expiration timestamp.
* @param string $prefix
* @param array|bool|null $serializableClasses
*/
public function __construct(
protected DynamoDbClient $dynamo,
protected $tabl | * @param string $keyAttribute The name of the attribute that should hold the key.
* @param string $valueAttribute The name of the attribute that should hold the value.
* @param string $expirationAttribute The | {
"filepath": "src/Illuminate/Cache/DynamoDbStore.php",
"language": "php",
"file_size": 16090,
"cut_index": 921,
"middle_length": 229
} |
class LuaScripts
{
/**
* Get the Lua script that sets a key only when it does not yet exist.
*
* KEYS[1] - The name of the key
* ARGV[1] - The value of the key
* ARGV[2] - The number of seconds the key should be valid
*
* @return string
*/
public static function add()
... | GV[1] - The owner key of the lock instance trying to release it
*
* @return string
*/
public static function releaseLock()
{
return <<<'LUA'
if redis.call("get",KEYS[1]) == ARGV[1] then
return redis.call("del",KEYS[1])
el | *
* KEYS[1] - The name of the lock
* AR | {
"filepath": "src/Illuminate/Cache/LuaScripts.php",
"language": "php",
"file_size": 888,
"cut_index": 547,
"middle_length": 52
} |
implements LockProvider
{
use InteractsWithTime;
/**
* The Memcached instance.
*
* @var \Memcached
*/
protected $memcached;
/**
* A string that should be prepended to keys.
*
* @var string
*/
protected $prefix;
/**
* Indicates whether we are using ... | hed', 'getMulti'))
->getNumberOfParameters() == 2;
}
/**
* Retrieve an item from the cache by key.
*
* @param string $key
* @return mixed
*/
public function get($key)
{
$value = $this->memcach | ram string $prefix
*/
public function __construct($memcached, $prefix = '')
{
$this->setPrefix($prefix);
$this->memcached = $memcached;
$this->onVersionThree = (new ReflectionMethod('Memcac | {
"filepath": "src/Illuminate/Cache/MemcachedStore.php",
"language": "php",
"file_size": 6574,
"cut_index": 716,
"middle_length": 229
} |
Support\InteractsWithTime;
use function Illuminate\Support\enum_value;
class RateLimiter
{
use InteractsWithTime;
/**
* The cache store implementation.
*
* @var \Illuminate\Contracts\Cache\Repository
*/
protected $cache;
/**
* The configured limit object resolvers.
*
... | @return $this
*/
public function for($name, Closure $callback)
{
$resolvedName = $this->resolveLimiterName($name);
$this->limiters[$resolvedName] = $callback;
return $this;
}
/**
* Get the given named ra | c function __construct(Cache $cache)
{
$this->cache = $cache;
}
/**
* Register a named rate limiter configuration.
*
* @param \UnitEnum|string $name
* @param \Closure $callback
* | {
"filepath": "src/Illuminate/Cache/RateLimiter.php",
"language": "php",
"file_size": 7890,
"cut_index": 716,
"middle_length": 229
} |
te\Cache;
class RedisLock extends Lock
{
/**
* The Redis factory implementation.
*
* @var \Illuminate\Redis\Connections\Connection
*/
protected $redis;
/**
* Create a new lock instance.
*
* @param \Illuminate\Redis\Connections\Connection $redis
* @param string $... | ->redis->set($this->name, $this->owner, 'EX', $this->seconds, 'NX') == true;
}
return $this->redis->setnx($this->name, $this->owner) === 1;
}
/**
* Release the lock.
*
* @return bool
*/
public function rele | econds, $owner);
$this->redis = $redis;
}
/**
* Attempt to acquire the lock.
*
* @return bool
*/
public function acquire()
{
if ($this->seconds > 0) {
return $this | {
"filepath": "src/Illuminate/Cache/RedisLock.php",
"language": "php",
"file_size": 1759,
"cut_index": 537,
"middle_length": 229
} |
hp
namespace Illuminate\Validation\Rules;
use Closure;
use InvalidArgumentException;
use Stringable;
class ProhibitedUnless implements Stringable
{
/**
* The condition that validates the attribute.
*
* @var (\Closure(): bool)|bool
*/
public $condition;
/**
* Create a new prohibi... | le or boolean.');
}
}
/**
* Convert the rule to a validation string.
*
* @return string
*/
public function __toString()
{
if (is_callable($this->condition)) {
return call_user_func($this->con | dition)
{
if ($condition instanceof Closure || is_bool($condition)) {
$this->condition = $condition;
} else {
throw new InvalidArgumentException('The provided condition must be a callab | {
"filepath": "src/Illuminate/Validation/Rules/ProhibitedUnless.php",
"language": "php",
"file_size": 1101,
"cut_index": 515,
"middle_length": 229
} |
pace Illuminate\Cache;
class ApcWrapper
{
/**
* Get an item from the cache.
*
* @param string $key
* @return mixed
*/
public function get($key)
{
$fetchedValue = apcu_fetch($key, $success);
return $success ? $fetchedValue : null;
}
/**
* Store an it... | ion increment($key, $value)
{
return apcu_inc($key, $value);
}
/**
* Decrement the value of an item in the cache.
*
* @param string $key
* @param int $value
* @return int|false
*/
public function d | return apcu_store($key, $value, $seconds);
}
/**
* Increment the value of an item in the cache.
*
* @param string $key
* @param int $value
* @return int|false
*/
public funct | {
"filepath": "src/Illuminate/Cache/ApcWrapper.php",
"language": "php",
"file_size": 1433,
"cut_index": 524,
"middle_length": 229
} |
te\Cache;
class CacheLock extends Lock
{
/**
* The cache store implementation.
*
* @var \Illuminate\Contracts\Cache\Store
*/
protected $store;
/**
* Create a new lock instance.
*
* @param \Illuminate\Contracts\Cache\Store $store
* @param string $name
* @par... | return $this->store->add(
$this->name, $this->owner, $this->seconds
);
}
if (! is_null($this->store->get($this->name))) {
return false;
}
return ($this->seconds > 0)
|
$this->store = $store;
}
/**
* Attempt to acquire the lock.
*
* @return bool
*/
public function acquire()
{
if (method_exists($this->store, 'add') && $this->seconds > 0) {
| {
"filepath": "src/Illuminate/Cache/CacheLock.php",
"language": "php",
"file_size": 1809,
"cut_index": 537,
"middle_length": 229
} |
Support\Arr;
use Illuminate\Support\Collection;
use Illuminate\Support\InteractsWithTime;
use Illuminate\Support\Str;
use RuntimeException;
class DatabaseStore implements CanFlushLocks, LockProvider, Store
{
use InteractsWithTime;
/**
* The database connection instance.
*
* @var \Illuminate\Dat... | var string
*/
protected $prefix;
/**
* The name of the cache locks table.
*
* @var string
*/
protected $lockTable;
/**
* An array representation of the lock lottery odds.
*
* @var array
*/
| ctionInterface
*/
protected $lockConnection;
/**
* The name of the cache table.
*
* @var string
*/
protected $table;
/**
* A string that should be prepended to keys.
*
* @ | {
"filepath": "src/Illuminate/Cache/DatabaseStore.php",
"language": "php",
"file_size": 15981,
"cut_index": 921,
"middle_length": 229
} |
k extends Lock
{
/**
* Attempt to acquire the lock.
*
* @return bool
*/
public function acquire()
{
return true;
}
/**
* Release the lock.
*
* @return bool
*/
public function release()
{
return true;
}
/**
* Releases this... | function isLocked(): bool
{
return false;
}
/**
* Returns the owner value written into the driver for this lock.
*
* @return mixed
*/
protected function getCurrentOwner()
{
return $this->owner;
} | cess.
*
* @return bool
*/
public | {
"filepath": "src/Illuminate/Cache/NoLock.php",
"language": "php",
"file_size": 870,
"cut_index": 559,
"middle_length": 52
} |
hp
namespace Illuminate\Validation\Rules;
use Closure;
use InvalidArgumentException;
use Stringable;
class ProhibitedIf implements Stringable
{
/**
* The condition that validates the attribute.
*
* @var (\Closure(): bool)|bool
*/
public $condition;
/**
* Create a new prohibited ... | r boolean.');
}
}
/**
* Convert the rule to a validation string.
*
* @return string
*/
public function __toString()
{
if (is_callable($this->condition)) {
return call_user_func($this->conditi | on)
{
if ($condition instanceof Closure || is_bool($condition)) {
$this->condition = $condition;
} else {
throw new InvalidArgumentException('The provided condition must be a callable o | {
"filepath": "src/Illuminate/Validation/Rules/ProhibitedIf.php",
"language": "php",
"file_size": 1097,
"cut_index": 515,
"middle_length": 229
} |
pace Illuminate\Cache;
use Illuminate\Contracts\Support\DeferrableProvider;
use Illuminate\Support\ServiceProvider;
use Symfony\Component\Cache\Adapter\Psr16Adapter;
class CacheServiceProvider extends ServiceProvider implements DeferrableProvider
{
/**
* Register the service provider.
*
* @return v... | $this->app->singleton('memcached.connector', function () {
return new MemcachedConnector;
});
$this->app->singleton(RateLimiter::class, function ($app) {
return new RateLimiter($app->make('cache')->driver(
| 'cache.store', function ($app) {
return $app['cache']->driver();
});
$this->app->singleton('cache.psr6', function ($app) {
return new Psr16Adapter($app['cache.store']);
});
| {
"filepath": "src/Illuminate/Cache/CacheServiceProvider.php",
"language": "php",
"file_size": 1350,
"cut_index": 524,
"middle_length": 229
} |
namespace Illuminate\Validation\Rules;
use Closure;
use InvalidArgumentException;
use Stringable;
class RequiredUnless implements Stringable
{
/**
* The condition that validates the attribute.
*
* @var (\Closure(): bool)|bool
*/
public $condition;
/**
* Create a new required val... | throw new InvalidArgumentException('The provided condition must be a callable or boolean.');
}
}
/**
* Convert the rule to a validation string.
*
* @return string
*/
public function __toString()
{
if (i | tion)
{
if (is_null($condition)) {
$condition = false;
}
if ($condition instanceof Closure || is_bool($condition)) {
$this->condition = $condition;
} else {
| {
"filepath": "src/Illuminate/Validation/Rules/RequiredUnless.php",
"language": "php",
"file_size": 1176,
"cut_index": 518,
"middle_length": 229
} |
te\Validation\Rules;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Traits\Conditionable;
use Stringable;
class Unique implements Stringable
{
use Conditionable, DatabaseRule;
/**
* The ID that should be ignored.
*
* @var mixed
*/
protected $ignore;
/**
* The... | s->ignore = $id;
$this->idColumn = $idColumn ?? 'id';
return $this;
}
/**
* Ignore the given model during the unique check.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @param string|null $idColu | param string|null $idColumn
* @return $this
*/
public function ignore($id, $idColumn = null)
{
if ($id instanceof Model) {
return $this->ignoreModel($id, $idColumn);
}
$thi | {
"filepath": "src/Illuminate/Validation/Rules/Unique.php",
"language": "php",
"file_size": 1659,
"cut_index": 537,
"middle_length": 229
} |
class MemcachedConnector
{
/**
* Create a new Memcached connection.
*
* @param array $servers
* @param string|null $connectionId
* @param array $options
* @param array $credentials
* @return \Memcached
*/
public function connect(array $servers, $connectionId = nu... | connection is successful and return it back.
foreach ($servers as $server) {
$memcached->addServer(
$server['host'], $server['port'], $server['weight']
);
}
}
ret | verList()) {
// For each server in the array, we'll just extract the configuration and add
// the server to the Memcached connection. Once we have added all of these
// servers we'll verify the | {
"filepath": "src/Illuminate/Cache/MemcachedConnector.php",
"language": "php",
"file_size": 2382,
"cut_index": 563,
"middle_length": 229
} |
minate\Http\UploadedFile;
class File extends UploadedFile
{
/**
* The name of the file.
*
* @var string
*/
public $name;
/**
* The temporary file resource.
*
* @var resource
*/
public $tempFile;
/**
* The "size" to report.
*
* @var int
*... | $this->tempFilePath(), $name, $this->getMimeType(),
null, true
);
}
/**
* Create a new fake file.
*
* @param string $name
* @param string|int $kilobytes
* @return \Illuminate\Http\Testing\File
| * @param string $name
* @param resource $tempFile
*/
public function __construct($name, $tempFile)
{
$this->name = $name;
$this->tempFile = $tempFile;
parent::__construct(
| {
"filepath": "src/Illuminate/Http/Testing/File.php",
"language": "php",
"file_size": 2905,
"cut_index": 563,
"middle_length": 229
} |
hp
namespace Illuminate\Http\Resources\JsonApi\Exceptions;
use RuntimeException;
class ResourceIdentificationException extends RuntimeException
{
/**
* Create an exception indicating we were unable to determine the resource ID for the given resource.
*
* @param mixed $resource
* @return sel... | * @param mixed $resource
* @return self
*/
public static function attemptingToDetermineTypeFor($resource)
{
$resourceType = is_object($resource) ? $resource::class : gettype($resource);
return new self(sprintf(
| sprintf(
'Unable to resolve resource object ID for [%s].', $resourceType
));
}
/**
* Create an exception indicating we were unable to determine the resource type for the given resource.
*
| {
"filepath": "src/Illuminate/Http/Resources/JsonApi/Exceptions/ResourceIdentificationException.php",
"language": "php",
"file_size": 1093,
"cut_index": 515,
"middle_length": 229
} |
se Illuminate\Support\Arr;
class PaginatedResourceResponse extends ResourceResponse
{
/**
* Create an HTTP response that represents the object.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\JsonResponse
*/
public function toResponse($request)
{
r... | jsonOptions()
), function ($response) use ($request) {
$response->original = $this->resource->resource->map(function ($item) {
if (is_array($item)) {
return Arr::get($item, 'resource');
| ($request),
$this->resource->with($request),
$this->resource->additional
)
),
$this->calculateStatus(),
[],
$this->resource-> | {
"filepath": "src/Illuminate/Http/Resources/Json/PaginatedResourceResponse.php",
"language": "php",
"file_size": 2783,
"cut_index": 563,
"middle_length": 229
} |
minate\Http\Resources\CollectsResources;
use Illuminate\Pagination\AbstractCursorPaginator;
use Illuminate\Pagination\AbstractPaginator;
use IteratorAggregate;
class ResourceCollection extends JsonResource implements Countable, IteratorAggregate
{
use CollectsResources;
/**
* The resource that this resou... | ameters that should be added to the pagination links.
*
* @var array|null
*/
protected $queryParameters;
/**
* Create a new resource instance.
*
* @param mixed $resource
*/
public function __construct($reso | $collection;
/**
* Indicates if all existing request query parameters should be added to pagination links.
*
* @var bool
*/
protected $preserveAllQueryParameters = false;
/**
* The query par | {
"filepath": "src/Illuminate/Http/Resources/Json/ResourceCollection.php",
"language": "php",
"file_size": 3499,
"cut_index": 614,
"middle_length": 229
} |
aits\Macroable;
use InvalidArgumentException;
class Repository implements ArrayAccess, ConfigContract
{
use Macroable;
/**
* All of the configuration items.
*
* @var array<string,mixed>
*/
protected $items = [];
/**
* Create a new configuration repository.
*
* @para... | ring $key
* @param mixed $default
* @return mixed
*/
public function get($key, $default = null)
{
if (is_array($key)) {
return $this->getMany($key);
}
return Arr::get($this->items, $key, $defau |
* @param string $key
* @return bool
*/
public function has($key)
{
return Arr::has($this->items, $key);
}
/**
* Get the specified configuration value.
*
* @param array|st | {
"filepath": "src/Illuminate/Config/Repository.php",
"language": "php",
"file_size": 7194,
"cut_index": 716,
"middle_length": 229
} |
s\Connectors\PredisConnector;
use Illuminate\Support\Arr;
use Illuminate\Support\ConfigurationUrlParser;
use Illuminate\Support\RebindsCallbacksToSelf;
use InvalidArgumentException;
use ReflectionException;
use RuntimeException;
use function Illuminate\Support\enum_value;
/**
* @mixin \Illuminate\Redis\Connections\C... | ected $customCreators = [];
/**
* The Redis server configurations.
*
* @var array
*/
protected $config;
/**
* The Redis connections.
*
* @var mixed
*/
protected $connections;
/**
* Indicat | */
protected $app;
/**
* The name of the default driver.
*
* @var string
*/
protected $driver;
/**
* The registered custom driver creators.
*
* @var array
*/
prot | {
"filepath": "src/Illuminate/Redis/RedisManager.php",
"language": "php",
"file_size": 7094,
"cut_index": 716,
"middle_length": 229
} |
use Illuminate\Contracts\Support\DeferrableProvider;
use Illuminate\Support\Arr;
use Illuminate\Support\ServiceProvider;
class RedisServiceProvider extends ServiceProvider implements DeferrableProvider
{
/**
* Register the service provider.
*
* @return void
*/
public function register()
... | $this->app->bind('redis.connection', function ($app) {
return $app['redis']->connection();
});
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{ | , 'client', 'phpredis'), $config);
});
| {
"filepath": "src/Illuminate/Redis/RedisServiceProvider.php",
"language": "php",
"file_size": 910,
"cut_index": 547,
"middle_length": 52
} |
ate\Redis\Limiters\ConcurrencyLimiterBuilder;
use Illuminate\Redis\Limiters\DurationLimiterBuilder;
use Illuminate\Support\Traits\Macroable;
use Throwable;
/**
* @mixin \Redis
*/
abstract class Connection
{
use Macroable {
__call as macroCall;
}
/**
* The Redis client.
*
* @var \R... | allback
* @param string $method
* @return void
*/
abstract public function createSubscription($channels, Closure $callback, $method = 'subscribe');
/**
* Funnel a callback for a maximum number of simultaneous executions.
|
* @var \Illuminate\Contracts\Events\Dispatcher|null
*/
protected $events;
/**
* Subscribe to a set of given channels for messages.
*
* @param array|string $channels
* @param \Closure $c | {
"filepath": "src/Illuminate/Redis/Connections/Connection.php",
"language": "php",
"file_size": 6426,
"cut_index": 716,
"middle_length": 229
} |
* @var bool|null
*/
protected $supportsPacking;
/**
* Indicates if Redis supports LZF compression.
*
* @var bool|null
*/
protected $supportsLzf;
/**
* Indicates if Redis supports Zstd compression.
*
* @var bool|null
*/
protected $supportsZstd;
/**
... | if ($this->supportsPacking()) {
return array_map($this->client->_pack(...), $values);
}
if ($this->compressed()) {
if ($this->supportsLzf() && $this->lzfCompressed()) {
if (! function_exists('lzf | tring,string>
*
* @throws \RuntimeException
* @throws \UnexpectedValueException
*/
public function pack(array $values): array
{
if (empty($values)) {
return $values;
}
| {
"filepath": "src/Illuminate/Redis/Connections/PacksPhpRedisValues.php",
"language": "php",
"file_size": 6566,
"cut_index": 716,
"middle_length": 229
} |
InvalidArgumentException;
class PhpRedisClusterConnection extends PhpRedisConnection
{
/**
* The RedisCluster client.
*
* @var \RedisCluster
*/
protected $client;
/**
* The default node to use from the cluster.
*
* @var string|array
*/
protected $defaultNode;
... | $options['count'] ?? 10
);
if ($result === false) {
$result = [];
}
return $cursor === 0 && empty($result) ? false : [$cursor, $result];
}
/**
* Flush the selected Redis database on all master | n
*/
#[\Override]
public function scan($cursor, $options = [])
{
$result = $this->client->scan($cursor,
$options['node'] ?? $this->defaultNode(),
$options['match'] ?? '*',
| {
"filepath": "src/Illuminate/Redis/Connections/PhpRedisClusterConnection.php",
"language": "php",
"file_size": 2115,
"cut_index": 563,
"middle_length": 229
} |
callable
*/
protected $connector;
/**
* The connection configuration array.
*
* @var array
*/
protected $config;
/**
* Create a new PhpRedis connection.
*
* @param \Redis $client
* @param callable|null $connector
* @param array $config
*/
... | return $result !== false ? $result : null;
}
/**
* Get the values of all the given keys.
*
* @param array $keys
* @return array
*/
public function mget(array $keys)
{
return array_map(function ($value) {
| ector;
}
/**
* Returns the value of the given key.
*
* @param string $key
* @return string|null
*/
public function get($key)
{
$result = $this->command('get', [$key]);
| {
"filepath": "src/Illuminate/Redis/Connections/PhpRedisConnection.php",
"language": "php",
"file_size": 14303,
"cut_index": 921,
"middle_length": 229
} |
namespace Illuminate\Redis\Connections;
use Predis\Command\Redis\FLUSHDB;
use Predis\Command\ServerFlushDatabase;
class PredisClusterConnection extends PredisConnection
{
/**
* Get the keys that match the given pattern.
*
* @param string $pattern
* @return array
*/
public function ... | atabase::class
: FLUSHDB::class;
foreach ($this->client as $node) {
$node->executeCommand(tap(new $command)->setArguments(func_get_args()));
}
}
/**
* Determine if the connection is a cluster connectio |
/**
* Flush the selected Redis database on all cluster nodes.
*
* @return void
*/
public function flushdb()
{
$command = class_exists(ServerFlushDatabase::class)
? ServerFlushD | {
"filepath": "src/Illuminate/Redis/Connections/PredisClusterConnection.php",
"language": "php",
"file_size": 1125,
"cut_index": 518,
"middle_length": 229
} |
te\Redis\Connections;
use Closure;
use Illuminate\Contracts\Redis\Connection as ConnectionContract;
use Illuminate\Support\Collection;
use Predis\Command\Argument\ArrayableArgument;
/**
* @mixin \Predis\Client
*/
class PredisConnection extends Connection implements ConnectionContract
{
/**
* The Predis cli... | string $method
* @return void
*/
public function createSubscription($channels, Closure $callback, $method = 'subscribe')
{
$loop = $this->pubSubLoop();
$loop->{$method}(...array_values((array) $channels));
forea | __construct($client)
{
$this->client = $client;
}
/**
* Subscribe to a set of given channels for messages.
*
* @param array|string $channels
* @param \Closure $callback
* @param | {
"filepath": "src/Illuminate/Redis/Connections/PredisConnection.php",
"language": "php",
"file_size": 1723,
"cut_index": 537,
"middle_length": 229
} |
se Illuminate\Redis\Connections\Connection;
use Illuminate\Support\Sleep;
use Illuminate\Support\Str;
use Throwable;
class ConcurrencyLimiter
{
/**
* The Redis factory implementation.
*
* @var \Illuminate\Redis\Connections\Connection
*/
protected $redis;
/**
* The name of the limi... |
/**
* Create a new concurrency limiter instance.
*
* @param \Illuminate\Redis\Connections\Connection $redis
* @param string $name
* @param int $maxLocks
* @param int $releaseAfter
*/
public function __con | number of seconds a slot should be maintained.
*
* @var int
*/
protected $releaseAfter;
/**
* The cluster-safe key prefix for lock slots.
*
* @var string|null
*/
protected $prefix;
| {
"filepath": "src/Illuminate/Redis/Limiters/ConcurrencyLimiter.php",
"language": "php",
"file_size": 4552,
"cut_index": 614,
"middle_length": 229
} |
se Illuminate\Support\InteractsWithTime;
class ConcurrencyLimiterBuilder
{
use InteractsWithTime;
/**
* The Redis connection.
*
* @var \Illuminate\Redis\Connections\Connection
*/
public $connection;
/**
* The name of the lock.
*
* @var string
*/
public $nam... | t = 3;
/**
* The number of milliseconds to wait between attempts to acquire the lock.
*
* @var int
*/
public $sleep = 250;
/**
* Create a new builder instance.
*
* @param \Illuminate\Redis\Connections\Conne | n the lock until it is automatically released.
*
* @var int
*/
public $releaseAfter = 60;
/**
* The amount of time to block until a lock is available.
*
* @var int
*/
public $timeou | {
"filepath": "src/Illuminate/Redis/Limiters/ConcurrencyLimiterBuilder.php",
"language": "php",
"file_size": 3078,
"cut_index": 614,
"middle_length": 229
} |
se Illuminate\Support\Sleep;
class DurationLimiter
{
/**
* The Redis factory implementation.
*
* @var \Illuminate\Redis\Connections\Connection
*/
private $redis;
/**
* The unique name of the lock.
*
* @var string
*/
private $name;
/**
* The allowed num... | /**
* Create a new duration limiter instance.
*
* @param \Illuminate\Redis\Connections\Connection $redis
* @param string $name
* @param int $maxLocks
* @param int $decay
*/
public function __construct($redis, | cay;
/**
* The timestamp of the end of the current duration.
*
* @var int
*/
public $decaysAt;
/**
* The number of remaining slots.
*
* @var int
*/
public $remaining;
| {
"filepath": "src/Illuminate/Redis/Limiters/DurationLimiter.php",
"language": "php",
"file_size": 4696,
"cut_index": 614,
"middle_length": 229
} |
luminate\Contracts\Redis\LimiterTimeoutException;
use Illuminate\Support\InteractsWithTime;
class DurationLimiterBuilder
{
use InteractsWithTime;
/**
* The Redis connection.
*
* @var \Illuminate\Redis\Connections\Connection
*/
public $connection;
/**
* The name of the lock.
... | ut = 3;
/**
* The number of milliseconds to wait between attempts to acquire the lock.
*
* @var int
*/
public $sleep = 750;
/**
* Create a new builder instance.
*
* @param \Illuminate\Redis\Connections\Conn | **
* The amount of time the lock window is maintained.
*
* @var int
*/
public $decay;
/**
* The amount of time to block until a lock is available.
*
* @var int
*/
public $timeo | {
"filepath": "src/Illuminate/Redis/Limiters/DurationLimiterBuilder.php",
"language": "php",
"file_size": 3011,
"cut_index": 563,
"middle_length": 229
} |
ector implements Connector
{
/**
* Create a new connection.
*
* @param array $config
* @param array $options
* @return \Illuminate\Redis\Connections\PhpRedisConnection
*/
public function connect(array $config, array $options)
{
$formattedOptions = Arr::pull($config,... |
/**
* Create a new clustered PhpRedis connection.
*
* @param array $config
* @param array $clusterOptions
* @param array $options
* @return \Illuminate\Redis\Connections\PhpRedisClusterConnection
*/
public | attedOptions) {
return $this->createClient(array_merge(
$config, $options, $formattedOptions
));
};
return new PhpRedisConnection($connector(), $connector, $config);
}
| {
"filepath": "src/Illuminate/Redis/Connectors/PhpRedisConnector.php",
"language": "php",
"file_size": 12612,
"cut_index": 921,
"middle_length": 229
} |
Illuminate\Contracts\Redis\Connector;
use Illuminate\Redis\Connections\PredisClusterConnection;
use Illuminate\Redis\Connections\PredisConnection;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use InvalidArgumentException;
use Predis\Client;
class PredisConnector implements Connector
{
/**
* Create ... | 'prefix'] = $config['prefix'];
}
$config = $this->formatHost($config);
return new PredisConnection(new Client($config, $formattedOptions));
}
/**
* Create a new clustered Predis connection.
*
* @param arra | onfig, array $options)
{
$formattedOptions = array_merge(
['timeout' => 10.0], $options, Arr::pull($config, 'options', [])
);
if (isset($config['prefix'])) {
$formattedOptions[ | {
"filepath": "src/Illuminate/Redis/Connectors/PredisConnector.php",
"language": "php",
"file_size": 2654,
"cut_index": 563,
"middle_length": 229
} |
namespace Illuminate\Redis\Events;
class CommandExecuted
{
/**
* The Redis command that was executed.
*
* @var string
*/
public $command;
/**
* The array of command parameters.
*
* @var array
*/
public $parameters;
/**
* The number of milliseconds it ... | array $parameters
* @param float|null $time
* @param \Illuminate\Redis\Connections\Connection $connection
*/
public function __construct($command, $parameters, $time, $connection)
{
$this->time = $time;
$this-> | */
public $connection;
/**
* The Redis connection name.
*
* @var string
*/
public $connectionName;
/**
* Create a new event instance.
*
* @param string $command
* @param | {
"filepath": "src/Illuminate/Redis/Events/CommandExecuted.php",
"language": "php",
"file_size": 1169,
"cut_index": 518,
"middle_length": 229
} |
namespace Illuminate\Redis\Events;
use Throwable;
class CommandFailed
{
/**
* The Redis command that failed.
*
* @var string
*/
public $command;
/**
* The array of command parameters.
*
* @var array
*/
public $parameters;
/**
* The exception that was... | parameters
* @param \Throwable $exception
* @param \Illuminate\Redis\Connections\Connection $connection
*/
public function __construct($command, $parameters, Throwable $exception, $connection)
{
$this->command = $command; | lic $connection;
/**
* The Redis connection name.
*
* @var string
*/
public $connectionName;
/**
* Create a new event instance.
*
* @param string $command
* @param array $ | {
"filepath": "src/Illuminate/Redis/Events/CommandFailed.php",
"language": "php",
"file_size": 1189,
"cut_index": 518,
"middle_length": 229
} |
een registered.
*
* @var bool
*/
protected $registered = false;
/**
* The namespace for all real-time facades.
*
* @var string
*/
protected static $facadeNamespace = 'Facades\\';
/**
* The singleton instance of the loader.
*
* @var \Illuminate\Foundati... | c function getInstance(array $aliases = [])
{
if (is_null(static::$instance)) {
return static::$instance = new static($aliases);
}
$aliases = array_merge(static::$instance->getAliases(), $aliases);
static:: | s)
{
$this->aliases = $aliases;
}
/**
* Get or create the singleton alias loader instance.
*
* @param array $aliases
* @return \Illuminate\Foundation\AliasLoader
*/
public stati | {
"filepath": "src/Illuminate/Foundation/AliasLoader.php",
"language": "php",
"file_size": 5459,
"cut_index": 716,
"middle_length": 229
} |
CachesRoutes, HttpKernelInterface
{
use Macroable;
/**
* The Laravel framework version.
*
* @var string
*/
const VERSION = '13.12.0';
/**
* The base path for the Laravel installation.
*
* @var string
*/
protected $basePath;
/**
* The array of regi... | *
* @var callable[]
*/
protected $bootingCallbacks = [];
/**
* The array of booted callbacks.
*
* @var callable[]
*/
protected $bootedCallbacks = [];
/**
* The array of terminating callbacks.
*
| ool
*/
protected $hasBeenBootstrapped = false;
/**
* Indicates if the application has "booted".
*
* @var bool
*/
protected $booted = false;
/**
* The array of booting callbacks.
| {
"filepath": "src/Illuminate/Foundation/Application.php",
"language": "php",
"file_size": 47222,
"cut_index": 2151,
"middle_length": 229
} |
nate\Contracts\Cache\Factory;
use Illuminate\Contracts\Cache\Repository;
use Illuminate\Contracts\Foundation\MaintenanceMode;
class CacheBasedMaintenanceMode implements MaintenanceMode
{
/**
* The cache factory.
*
* @var \Illuminate\Contracts\Cache\Factory
*/
protected $cache;
/**
... | ring $key
*/
public function __construct(Factory $cache, string $store, string $key)
{
$this->cache = $cache;
$this->store = $store;
$this->key = $key;
}
/**
* Take the application down for maintenance.
| * @var string
*/
protected $key;
/**
* Create a new cache based maintenance mode implementation.
*
* @param \Illuminate\Contracts\Cache\Factory $cache
* @param string $store
* @param st | {
"filepath": "src/Illuminate/Foundation/CacheBasedMaintenanceMode.php",
"language": "php",
"file_size": 2093,
"cut_index": 563,
"middle_length": 229
} |
e\Foundation\Bootstrap\LoadConfiguration;
use Illuminate\Foundation\Cloud\Events;
use Illuminate\Foundation\Cloud\FailedJobProvider;
use Illuminate\Foundation\Cloud\QueueConnector;
use Illuminate\Queue\Connectors\SqsConnector;
use Monolog\Handler\SocketHandler;
use PDO;
class Cloud
{
/**
* Handle a bootstrapp... | */
public static function bootstrapperBootstrapped(Application $app, string $bootstrapper): void
{
(match ($bootstrapper) {
LoadConfiguration::class => function () use ($app) {
static::configureDisks($app);
| iders::class => function () use ($app) {
static::bootManagedQueues($app);
},
default => fn () => true,
})();
}
/**
* Handle a bootstrapper that has bootstrapped.
| {
"filepath": "src/Illuminate/Foundation/Cloud.php",
"language": "php",
"file_size": 7246,
"cut_index": 716,
"middle_length": 229
} |
ace;
use Composer\Script\Event;
use Illuminate\Concurrency\ProcessDriver;
use Illuminate\Encryption\EncryptionServiceProvider;
use Illuminate\Foundation\Bootstrap\LoadConfiguration;
use Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables;
use Throwable;
class ComposerScripts
{
/**
* Handle the post-insta... | */
public static function postUpdate(Event $event)
{
require_once $event->getComposer()->getConfig()->get('vendor-dir').'/autoload.php';
static::clearCompiled();
}
/**
* Handle the post-autoload-dump Composer event | omposer()->getConfig()->get('vendor-dir').'/autoload.php';
static::clearCompiled();
}
/**
* Handle the post-update Composer event.
*
* @param \Composer\Script\Event $event
* @return void
| {
"filepath": "src/Illuminate/Foundation/ComposerScripts.php",
"language": "php",
"file_size": 3558,
"cut_index": 614,
"middle_length": 229
} |
te\Foundation;
use Closure;
class EnvironmentDetector
{
/**
* Detect the application's current environment.
*
* @param \Closure $callback
* @param array|null $consoleArgs
* @return string
*/
public function detect(Closure $callback, $consoleArgs = null)
{
if ($con... | t the application environment from command-line arguments.
*
* @param \Closure $callback
* @param array $args
* @return string
*/
protected function detectConsoleEnvironment(Closure $callback, array $args)
{
// | tion environment for a web request.
*
* @param \Closure $callback
* @return string
*/
protected function detectWebEnvironment(Closure $callback)
{
return $callback();
}
/**
* Se | {
"filepath": "src/Illuminate/Foundation/EnvironmentDetector.php",
"language": "php",
"file_size": 1938,
"cut_index": 537,
"middle_length": 229
} |
pace Illuminate\Foundation;
use Illuminate\Contracts\Foundation\MaintenanceMode as MaintenanceModeContract;
class FileBasedMaintenanceMode implements MaintenanceModeContract
{
/**
* Take the application down for maintenance.
*
* @param array $payload
* @return void
*/
public functio... | ation is currently down for maintenance.
*
* @return bool
*/
public function active(): bool
{
return file_exists($this->path());
}
/**
* Get the data array which was provided when the application was placed into | ication out of maintenance.
*
* @return void
*/
public function deactivate(): void
{
if ($this->active()) {
unlink($this->path());
}
}
/**
* Determine if the applic | {
"filepath": "src/Illuminate/Foundation/FileBasedMaintenanceMode.php",
"language": "php",
"file_size": 1422,
"cut_index": 524,
"middle_length": 229
} |
.~)>>
.~))))>>>
.~))>> ___
.~))>>)))>> .-~))>>
.~)))))>> .-~))>>)>
... | (\_(\-\b |))>)) //)))>>)))))))>>)>
(( @@@(.@(@ . _/`-` ~|b |>))) //)>>)))))))>>)>
)* @@@ )@* (@) (@) /\b|))) //))))))>>))))>>
(( @. )@( @ . _/ / / \b)) //))>>)))))>>>_._
)@@ (@@*)@@. (6///6)- / ^ \b)//))))))>>)))>> | //))>>))) .-~))>>)))))>>)>
(( @.@). //))))) .-~)>>)))))>>)>
)) )@@*.@@ ) //)>))) //))))))>>))))>>)>
(( ((@@@.@@ |/))))) //)))))>>)))>>)>
)) @@*. )@@ ) | {
"filepath": "src/Illuminate/Foundation/Inspiring.php",
"language": "php",
"file_size": 6832,
"cut_index": 716,
"middle_length": 229
} |
namespace Illuminate\Foundation;
use Illuminate\Support\Manager;
class MaintenanceModeManager extends Manager
{
/**
* Create an instance of the file based maintenance driver.
*
* @return \Illuminate\Foundation\FileBasedMaintenanceMode
*/
protected function createFileDriver(): FileBasedMai... | eMode(
$this->container->make('cache'),
$this->config->get('app.maintenance.store') ?: $this->config->get('cache.default'),
'illuminate:foundation:down'
);
}
/**
* Get the default driver name.
| acheBasedMaintenanceMode
*
* @throws \Illuminate\Contracts\Container\BindingResolutionException
*/
protected function createCacheDriver(): CacheBasedMaintenanceMode
{
return new CacheBasedMaintenanc | {
"filepath": "src/Illuminate/Foundation/MaintenanceModeManager.php",
"language": "php",
"file_size": 1165,
"cut_index": 518,
"middle_length": 229
} |
nate\Support\HtmlString;
use Illuminate\Support\Str;
class Mix
{
/**
* Get the path to a versioned Mix file.
*
* @param string $path
* @param string $manifestDirectory
* @return \Illuminate\Support\HtmlString|string
*
* @throws \Illuminate\Foundation\MixManifestNotFoundExcept... | ic_path($manifestDirectory.'/hot'))) {
$url = rtrim(file_get_contents(public_path($manifestDirectory.'/hot')));
$customUrl = app('config')->get('app.mix_hot_proxy_url');
if (! empty($customUrl)) {
retur | ath, '/')) {
$path = "/{$path}";
}
if ($manifestDirectory && ! str_starts_with($manifestDirectory, '/')) {
$manifestDirectory = "/{$manifestDirectory}";
}
if (is_file(publ | {
"filepath": "src/Illuminate/Foundation/Mix.php",
"language": "php",
"file_size": 2214,
"cut_index": 563,
"middle_length": 229
} |
minate\Support\Collection;
use Illuminate\Support\Env;
class PackageManifest
{
/**
* The filesystem instance.
*
* @var \Illuminate\Filesystem\Filesystem
*/
public $files;
/**
* The base path.
*
* @var string
*/
public $basePath;
/**
* The vendor path.
... | m string $manifestPath
*/
public function __construct(Filesystem $files, $basePath, $manifestPath)
{
$this->files = $files;
$this->basePath = $basePath;
$this->manifestPath = $manifestPath;
$this->vendorPath = | t array.
*
* @var array
*/
public $manifest;
/**
* Create a new package manifest instance.
*
* @param \Illuminate\Filesystem\Filesystem $files
* @param string $basePath
* @para | {
"filepath": "src/Illuminate/Foundation/PackageManifest.php",
"language": "php",
"file_size": 4462,
"cut_index": 614,
"middle_length": 229
} |
* The application implementation.
*
* @var \Illuminate\Contracts\Foundation\Application
*/
protected $app;
/**
* The filesystem instance.
*
* @var \Illuminate\Filesystem\Filesystem
*/
protected $files;
/**
* The path to the manifest file.
*
* @var s... | = $files;
$this->manifestPath = $manifestPath;
}
/**
* Register the application service providers.
*
* @param array $providers
* @return void
*/
public function load(array $providers)
{
$manifest | luminate\Filesystem\Filesystem $files
* @param string $manifestPath
*/
public function __construct(ApplicationContract $app, Filesystem $files, $manifestPath)
{
$this->app = $app;
$this->files | {
"filepath": "src/Illuminate/Foundation/ProviderRepository.php",
"language": "php",
"file_size": 6366,
"cut_index": 716,
"middle_length": 229
} |
loaded assets.
*
* @var array
*/
protected $preloadedAssets = [];
/**
* The cached manifest files.
*
* @var array
*/
protected static $manifests = [];
/**
* The ViteFonts instance.
*
* @var \Illuminate\Foundation\ViteFonts|null
*/
protected $f... | int
*/
protected $prefetchConcurrently = 3;
/**
* The name of the event that should trigger prefetching. The event must be dispatched on the `window`.
*
* @var string
*/
protected $prefetchEvent = 'load';
/**
| strategy to use.
*
* @var null|'waterfall'|'aggressive'
*/
protected $prefetchStrategy = null;
/**
* The number of assets to load concurrently when using the "waterfall" strategy.
*
* @var | {
"filepath": "src/Illuminate/Foundation/Vite.php",
"language": "php",
"file_size": 35244,
"cut_index": 2151,
"middle_length": 229
} |
/**
* Read the font manifest for the given configuration.
*
* @param bool $isHot
* @param string $buildDirectory
* @param string $manifestFilename
* @param string $hotFile
* @return array<string, mixed>|null
*
* @throws \Illuminate\Foundation\ViteException
*/... | tring, mixed>|null
*
* @throws \Illuminate\Foundation\ViteException
*/
protected function readManifest(string $path)
{
if (isset(static::$manifests[$path])) {
return static::$manifests[$path];
}
i | json'
: public_path($buildDirectory.'/'.$manifestFilename);
return $this->readManifest($path);
}
/**
* Read and decode a manifest file.
*
* @param string $path
* @return array<s | {
"filepath": "src/Illuminate/Foundation/ViteFonts.php",
"language": "php",
"file_size": 7433,
"cut_index": 716,
"middle_length": 229
} |
as ValidatorContract;
use Illuminate\Contracts\View\Factory as ViewFactory;
use Illuminate\Contracts\View\View as ViewContract;
use Illuminate\Cookie\CookieJar;
use Illuminate\Foundation\Bus\PendingClosureDispatch;
use Illuminate\Foundation\Bus\PendingDispatch;
use Illuminate\Foundation\Mix;
use Illuminate\Http\Except... | e Illuminate\Support\Facades\Date;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\HtmlString;
use Illuminate\Support\Uri;
use League\Uri\Contracts\UriInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\Cookie;
use Sym | \Log\LogManager;
use Illuminate\Queue\CallQueuedClosure;
use Illuminate\Routing\Redirector;
use Illuminate\Routing\Router;
use Illuminate\Support\Defer\DeferredCallback;
use Illuminate\Support\Defer\DeferredCallbackCollection;
us | {
"filepath": "src/Illuminate/Foundation/helpers.php",
"language": "php",
"file_size": 29769,
"cut_index": 1331,
"middle_length": 229
} |
harset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ config('app.name', 'Laravel') }}</title>
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.bunny.net">
<link href="https://fonts.bunny.net/css?family=figtree:400,600&display=swap" rel="stylesheet... | tion:bg-red-500 selection:text-white">
<div class="w-full sm:w-3/4 xl:w-1/2 mx-auto p-6">
<div class="px-6 py-4 bg-white from-gray-700/50 via-transparent rounded-lg shadow-2xl shadow-gray-500/20 flex items-center focus:outline focus:outline-2 f | e', 'ui-sans-serif', 'system-ui', 'sans-serif', "Apple Color Emoji", "Segoe UI Emoji";
}
</style>
</head>
<body class="antialiased">
<div class="relative flex justify-center items-center min-h-screen bg-gray-100 selec | {
"filepath": "src/Illuminate/Foundation/resources/health-up.blade.php",
"language": "php",
"file_size": 2031,
"cut_index": 563,
"middle_length": 229
} |
use Illuminate\Container\Container;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\AnonymousResourceCollection as BaseAnonymousResourceCollection;
use Illuminate\Support\Arr;
class AnonymousResourceCollection extends BaseAnonymousResourceCollection
{
use Concern... | st))
->flatten(depth: 1)
->uniqueStrict('_uniqueKey')
->map(fn ($included) => Arr::except($included, ['_uniqueKey']))
->values()
->all(),
...($implementation = Json |
*/
#[\Override]
public function with($request)
{
return array_filter([
'included' => $this->collection
->map(fn ($resource) => $resource->resolveIncludedResourceObjects($reque | {
"filepath": "src/Illuminate/Http/Resources/JsonApi/AnonymousResourceCollection.php",
"language": "php",
"file_size": 2564,
"cut_index": 563,
"middle_length": 229
} |
te\Http\Resources\JsonApi;
use Closure;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* @internal
*/
class RelationResolver
{
/**
* The relation resolver.
*
* @var \Closure(mixed):(\Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Mo... | \Model|null)|class-string<\Illuminate\Http\Resources\JsonApi\JsonApiResource>|null $resolver
*/
public function __construct(public string $relationName, Closure|string|null $resolver = null)
{
$this->relationResolver = match (true) {
| */
public ?string $relationResourceClass = null;
/**
* Construct a new resource relationship resolver.
*
* @param \Closure(mixed):(\Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent | {
"filepath": "src/Illuminate/Http/Resources/JsonApi/RelationResolver.php",
"language": "php",
"file_size": 1750,
"cut_index": 537,
"middle_length": 229
} |
use GuzzleHttp\Promise\PromiseInterface;
use Illuminate\Support\Traits\ForwardsCalls;
/**
* A decorated Promise which allows for chaining callbacks.
*/
class FluentPromise implements PromiseInterface
{
use ForwardsCalls;
/**
* Create a new fluent promise instance.
*
* @param \GuzzleHttp\Prom... | {
return $this->__call('otherwise', [$onRejected]);
}
#[\Override]
public function resolve($value): void
{
$this->guzzlePromise->resolve($value);
}
#[\Override]
public function reject($reason): void
{
| illed = null, ?callable $onRejected = null): PromiseInterface
{
return $this->__call('then', [$onFulfilled, $onRejected]);
}
#[\Override]
public function otherwise(callable $onRejected): PromiseInterface
| {
"filepath": "src/Illuminate/Http/Client/Promises/FluentPromise.php",
"language": "php",
"file_size": 2173,
"cut_index": 563,
"middle_length": 229
} |
ne if the response code was 200 "OK" response.
*
* @return bool
*/
public function ok()
{
return $this->status() === 200;
}
/**
* Determine if the response code was 201 "Created" response.
*
* @return bool
*/
public function created()
{
return ... | status = 204)
{
return $this->status() === $status && $this->body() === '';
}
/**
* Determine if the response code was a 301 "Moved Permanently".
*
* @return bool
*/
public function movedPermanently()
{
| n $this->status() === 202;
}
/**
* Determine if the response code was the given status code and the body has no content.
*
* @param int $status
* @return bool
*/
public function noContent($ | {
"filepath": "src/Illuminate/Http/Client/Concerns/DeterminesStatusCode.php",
"language": "php",
"file_size": 3561,
"cut_index": 614,
"middle_length": 229
} |
ublic function isJson()
{
return Str::contains($this->header('CONTENT_TYPE') ?? '', ['/json', '+json']);
}
/**
* Determine if the current request probably expects a JSON response.
*
* @return bool
*/
public function expectsJson()
{
return ($this->ajax() && ! $thi... | ent request is asking for Markdown.
*
* @return bool
*/
public function wantsMarkdown()
{
$acceptable = $this->getAcceptableContentTypes();
return isset($acceptable[0]) && str_starts_with(strtolower($acceptable[0]), | ction wantsJson()
{
$acceptable = $this->getAcceptableContentTypes();
return isset($acceptable[0]) && Str::contains(strtolower($acceptable[0]), ['/json', '+json']);
}
/**
* Determine if the curr | {
"filepath": "src/Illuminate/Http/Concerns/InteractsWithContentTypes.php",
"language": "php",
"file_size": 5128,
"cut_index": 716,
"middle_length": 229
} |
te\Http\Concerns;
use Illuminate\Support\Collection;
trait CanBePrecognitive
{
/**
* Filter the given array of rules into an array of rules that are included in precognitive headers.
*
* @param array $rules
* @return array
*/
public function filterPrecognitiveRules($rules)
{
... | hould be validated.
*
* @param string $attribute
* @param array $validateOnly
* @return bool
*/
protected function shouldValidatePrecognitiveAttribute($attribute, $validateOnly)
{
foreach ($validateOnly as $patt | return (new Collection($rules))
->filter(fn ($rule, $attribute) => $this->shouldValidatePrecognitiveAttribute($attribute, $validateOnly))
->all();
}
/**
* Determine if the given attribute s | {
"filepath": "src/Illuminate/Http/Concerns/CanBePrecognitive.php",
"language": "php",
"file_size": 1680,
"cut_index": 537,
"middle_length": 229
} |
namespace Illuminate\Http\Middleware;
use Illuminate\Http\Response;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Vite;
class AddLinkHeadersForPreloadedAssets
{
/**
* Configure the middleware.
*
* @param int $limit
* @return string
*/
public static function usin... | if ($response instanceof Response && Vite::preloadedAssets() !== []) {
$response->header('Link', (new Collection(Vite::preloadedAssets()))
->when($limit, fn ($assets, $limit) => $assets->take($limit))
| ext
* @param int|null $limit
* @return \Illuminate\Http\Response
*/
public function handle($request, $next, $limit = null)
{
return tap($next($request), function ($response) use ($limit) {
| {
"filepath": "src/Illuminate/Http/Middleware/AddLinkHeadersForPreloadedAssets.php",
"language": "php",
"file_size": 1158,
"cut_index": 518,
"middle_length": 229
} |
ate\Contracts\Container\Container;
use Illuminate\Http\Request;
class HandleCors
{
/**
* The container instance.
*
* @var \Illuminate\Contracts\Container\Container
*/
protected $container;
/**
* The CORS service instance.
*
* @var \Fruitcake\Cors\CorsService
*/
... | ontainer, CorsService $cors)
{
$this->container = $container;
$this->cors = $cors;
}
/**
* Handle the incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return |
/**
* Create a new middleware instance.
*
* @param \Illuminate\Contracts\Container\Container $container
* @param \Fruitcake\Cors\CorsService $cors
*/
public function __construct(Container $c | {
"filepath": "src/Illuminate/Http/Middleware/HandleCors.php",
"language": "php",
"file_size": 3448,
"cut_index": 614,
"middle_length": 229
} |
losure;
use Illuminate\Support\Carbon;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpFoundation\StreamedResponse;
class SetCacheHeaders
{
/**
* Specify the options for the middleware.
*
* @param arra... | $value : "{$key}={$value}";
})
->filter()
->map(fn ($value) => Str::finish($value, ';'))
->pipe(fn ($options) => rtrim(static::class.':'.$options->implode(''), ';'));
}
/**
* Add cache related | return (new Collection($options))
->map(function ($value, $key) {
if (is_bool($value)) {
return $value ? $key : null;
}
return is_int($key) ? | {
"filepath": "src/Illuminate/Http/Middleware/SetCacheHeaders.php",
"language": "php",
"file_size": 2891,
"cut_index": 563,
"middle_length": 229
} |
namespace Illuminate\Http\Middleware;
use Closure;
use Illuminate\Http\Exceptions\PostTooLargeException;
class ValidatePostSize
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*
* @throws \Illuminate\H... | n int
*/
protected function getPostMaxSize()
{
if (is_numeric($postMaxSize = ini_get('post_max_size'))) {
return (int) $postMaxSize;
}
$metric = strtoupper(substr($postMaxSize, -1));
$postMaxSize = | T_LENGTH') > $max) {
throw new PostTooLargeException('The POST data is too large.');
}
return $next($request);
}
/**
* Determine the server 'post_max_size' as bytes.
*
* @retur | {
"filepath": "src/Illuminate/Http/Middleware/ValidatePostSize.php",
"language": "php",
"file_size": 1243,
"cut_index": 518,
"middle_length": 229
} |
pace Illuminate\Http\Testing;
use Illuminate\Support\Arr;
use Symfony\Component\Mime\MimeTypes;
class MimeType
{
/**
* The MIME types instance.
*
* @var \Symfony\Component\Mime\MimeTypes|null
*/
private static $mime;
/**
* Get the MIME types instance.
*
* @return \Symfo... | tension = pathinfo($filename, PATHINFO_EXTENSION);
return self::get($extension);
}
/**
* Get the MIME type for a given extension or return all MIME types.
*
* @param string $extension
* @return string
*/
pub | urn self::$mime;
}
/**
* Get the MIME type for a file based on the file's extension.
*
* @param string $filename
* @return string
*/
public static function from($filename)
{
$ex | {
"filepath": "src/Illuminate/Http/Testing/MimeType.php",
"language": "php",
"file_size": 1434,
"cut_index": 524,
"middle_length": 229
} |
luminate\Http\Resources\Json\JsonResource;
use Illuminate\Pagination\AbstractCursorPaginator;
use Illuminate\Pagination\AbstractPaginator;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use LogicException;
use ReflectionClass;
use Traversable;
trait CollectsResources
{
/**
* The cached Collect... | e;
}
if (is_array($resource)) {
$resource = new Collection($resource);
}
$collects = $this->collects();
$this->collection = $collects && ! $resource->first() instanceof $collects
? $resourc | to its individual resources.
*
* @param mixed $resource
* @return mixed
*/
protected function collectResource($resource)
{
if ($resource instanceof MissingValue) {
return $resourc | {
"filepath": "src/Illuminate/Http/Resources/CollectsResources.php",
"language": "php",
"file_size": 3377,
"cut_index": 614,
"middle_length": 229
} |
ter the given data, removing any optional values.
*
* @param array $data
* @return array
*/
protected function filter($data)
{
$index = -1;
foreach ($data as $key => $value) {
$index++;
if (is_array($value)) {
$data[$key] = $this->f... | $key] = null;
}
}
return $this->removeMissingValues($data);
}
/**
* Merge the given data in at the given index.
*
* @param array $data
* @param int $index
* @param array $merge
* @pa | $index, $this->filter($value->data),
array_values($value->data) === $value->data
);
}
if ($value instanceof self && is_null($value->resource)) {
$data[ | {
"filepath": "src/Illuminate/Http/Resources/ConditionallyLoadsAttributes.php",
"language": "php",
"file_size": 13121,
"cut_index": 921,
"middle_length": 229
} |
ate\Contracts\Support\Responsable;
use Illuminate\Database\Eloquent\JsonEncodingException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Attributes\PreserveKeys;
use Illuminate\Http\Resources\ConditionallyLoadsAttributes;
use Illuminate\Http\Resources\DelegatesToResource;
... | */
public $with = [];
/**
* The additional metadata that should be added to the resource response.
*
* Added during response construction by the developer.
*
* @var array
*/
public $additional = [];
/**
| egatesToResource;
/**
* The resource instance.
*
* @var mixed
*/
public $resource;
/**
* The additional data that should be added to the top-level resource array.
*
* @var array
| {
"filepath": "src/Illuminate/Http/Resources/Json/JsonResource.php",
"language": "php",
"file_size": 8323,
"cut_index": 716,
"middle_length": 229
} |
luminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;
class ResourceResponse implements Responsable
{
/**
* The underlying resource.
*
* @var mixed
*/
public $resource;
/**
* Create a new resource response.
*
* @param mixed $resource
*/
public f... | $this->resource->with($request),
$this->resource->additional
),
$this->calculateStatus(),
[],
$this->resource->jsonOptions()
), function ($response) use ($request) {
| st $request
* @return \Illuminate\Http\JsonResponse
*/
public function toResponse($request)
{
return tap(response()->json(
$this->wrap(
$this->resource->resolve($request),
| {
"filepath": "src/Illuminate/Http/Resources/Json/ResourceResponse.php",
"language": "php",
"file_size": 3383,
"cut_index": 614,
"middle_length": 229
} |
ate\Support\Arr;
class JsonApiResource extends JsonResource
{
use Concerns\ResolvesJsonApiElements,
Concerns\ResolvesJsonApiRequest;
/**
* The "data" wrapper that should be applied.
*
* @var string|null
*/
public static $wrap = 'data';
/**
* The resource's "version" f... | * @return void
*/
public static function configure(?string $version = null, array $ext = [], array $profile = [], array $meta = [])
{
static::$jsonApiInformation = array_filter([
'version' => $version,
'ext' => | or JSON:API.
*/
protected array $jsonApiLinks = [];
/**
* The resource's "meta" for JSON:API.
*/
protected array $jsonApiMeta = [];
/**
* Set the JSON:API version for the request.
*
| {
"filepath": "src/Illuminate/Http/Resources/JsonApi/JsonApiResource.php",
"language": "php",
"file_size": 6219,
"cut_index": 716,
"middle_length": 229
} |
e;
use RuntimeException;
class LazyPromise implements PromiseInterface
{
/**
* The callbacks to execute after the Guzzle Promise has been built.
*
* @var list<callable>
*/
protected array $pending = [];
/**
* The promise built by the creator.
*
* @var \GuzzleHttp\Promise... | * @return \GuzzleHttp\Promise\PromiseInterface
*
* @throws \RuntimeException If the promise has already been built
*/
public function buildPromise(): PromiseInterface
{
if (! $this->promiseNeedsBuilt()) {
throw ne | face) $promiseBuilder The callback to build a new PromiseInterface.
*/
public function __construct(protected Closure $promiseBuilder)
{
}
/**
* Build the promise from the promise builder.
*
| {
"filepath": "src/Illuminate/Http/Client/Promises/LazyPromise.php",
"language": "php",
"file_size": 3235,
"cut_index": 614,
"middle_length": 229
} |
te\Http\Concerns;
use Illuminate\Database\Eloquent\Model;
trait InteractsWithFlashData
{
/**
* Retrieve an old input item.
*
* @param string|null $key
* @param \Illuminate\Database\Eloquent\Model|string|array|null $default
* @return string|array|null
*/
public function old($k... | }
/**
* Flash only some of the input to the session.
*
* @param mixed $keys
* @return void
*/
public function flashOnly($keys)
{
$this->session()->flashInput(
$this->only(is_array($keys) ? $keys | ey, $default) : $default;
}
/**
* Flash the input for the current request to the session.
*
* @return void
*/
public function flash()
{
$this->session()->flashInput($this->input());
| {
"filepath": "src/Illuminate/Http/Concerns/InteractsWithFlashData.php",
"language": "php",
"file_size": 1532,
"cut_index": 537,
"middle_length": 229
} |
te\Http\Middleware;
use Closure;
class PrefersJsonResponses
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$accept = $request->headers->g... | eader is broad when it's missing or every media-type listed is wildcard ("*\/*" or "application/*").
*
* @param string|null $accept
* @return bool
*/
protected function acceptHeaderIsBroad($accept)
{
if ($accept === nu | $request->headers->set('Accept', 'application/json');
}
return $next($request);
}
/**
* Determine if the given "Accept" header value is broad enough to be treated as JSON.
*
* The h | {
"filepath": "src/Illuminate/Http/Middleware/PrefersJsonResponses.php",
"language": "php",
"file_size": 1562,
"cut_index": 537,
"middle_length": 229
} |
string|null
*/
protected $proxies;
/**
* The trusted proxies headers for the application.
*
* @var int
*/
protected $headers = Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED... | ysTrustHeaders;
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*
* @throws \Symfony\Component\HttpKernel\Exception\HttpException
*/
| r array<int, string>|string|null
*/
protected static $alwaysTrustProxies;
/**
* The proxies headers that have been configured to always be trusted.
*
* @var int|null
*/
protected static $alwa | {
"filepath": "src/Illuminate/Http/Middleware/TrustProxies.php",
"language": "php",
"file_size": 5872,
"cut_index": 716,
"middle_length": 229
} |
e Symfony\Component\HttpFoundation\Response;
use Throwable;
class HttpResponseException extends RuntimeException
{
/**
* The underlying response instance.
*
* @var \Symfony\Component\HttpFoundation\Response
*/
protected $response;
/**
* Create a new HTTP response exception instanc... | $previous?->getMessage() ?? '', $previous?->getCode() ?? 0, $previous);
$this->response = $response;
}
/**
* Get the underlying response instance.
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public fu | $previous = null)
{
parent::__construct( | {
"filepath": "src/Illuminate/Http/Exceptions/HttpResponseException.php",
"language": "php",
"file_size": 957,
"cut_index": 582,
"middle_length": 52
} |
Illuminate\Http\Resources\Json;
class AnonymousResourceCollection extends ResourceCollection
{
/**
* The name of the resource being collected.
*
* @var string
*/
public $collects;
/**
* Indicates if the collection keys should be preserved.
*
* @var bool
*/
publi... | ects = $collects;
parent::__construct($resource);
}
/**
* Indicate that the collection keys should be preserved.
*/
public function preserveKeys(bool $value = true): static
{
$this->preserveKeys = $value;
| ruct($resource, $collects)
{
$this->coll | {
"filepath": "src/Illuminate/Http/Resources/Json/AnonymousResourceCollection.php",
"language": "php",
"file_size": 861,
"cut_index": 529,
"middle_length": 52
} |
ces\Json\JsonResource;
use Illuminate\Http\Resources\JsonApi\Exceptions\ResourceIdentificationException;
use Illuminate\Http\Resources\JsonApi\JsonApiRequest;
use Illuminate\Http\Resources\JsonApi\JsonApiResource;
use Illuminate\Http\Resources\JsonApi\RelationResolver;
use Illuminate\Http\Resources\MissingValue;
use Il... | ager loaded relationship.
*/
protected bool $includesPreviouslyLoadedRelationships = false;
/**
* Cached loaded relationships map.
*
* @var array<int, array{0: \Illuminate\Http\Resources\JsonApi\JsonApiResource, 1: string, 2: s | /**
* Determine whether resources respect inclusions and fields from the request.
*/
protected bool $usesRequestQueryString = true;
/**
* Determine whether included relationship for the resource from e | {
"filepath": "src/Illuminate/Http/Resources/JsonApi/Concerns/ResolvesJsonApiElements.php",
"language": "php",
"file_size": 15458,
"cut_index": 921,
"middle_length": 229
} |
ts\InteractsWithData;
use SplFileInfo;
use Symfony\Component\HttpFoundation\InputBag;
trait InteractsWithInput
{
use Dumpable, InteractsWithData;
/**
* Retrieve a server variable from the request.
*
* @param string|null $key
* @param string|array|null $default
* @return string|arr... | *
* @param string|null $key
* @param string|array|null $default
* @return string|array|null
*/
public function header($key = null, $default = null)
{
return $this->retrieveItem('headers', $key, $default);
}
| on the request.
*
* @param string $key
* @return bool
*/
public function hasHeader($key)
{
return ! is_null($this->header($key));
}
/**
* Retrieve a header from the request.
| {
"filepath": "src/Illuminate/Http/Concerns/InteractsWithInput.php",
"language": "php",
"file_size": 7577,
"cut_index": 716,
"middle_length": 229
} |
cException;
class FileFactory
{
/**
* Create a new fake file.
*
* @param string $name
* @param string|int $kilobytes
* @param string|null $mimeType
* @return \Illuminate\Http\Testing\File
*/
public function create($name, $kilobytes = 0, $mimeType = null)
{
i... | string $content
* @return \Illuminate\Http\Testing\File
*/
public function createWithContent($name, $content)
{
$tmpfile = tmpfile();
fwrite($tmpfile, $content);
return tap(new File($name, $tmpfile), function ($ | e) {
$file->sizeToReport = $kilobytes * 1024;
$file->mimeTypeToReport = $mimeType;
});
}
/**
* Create a new fake file with content.
*
* @param string $name
* @param | {
"filepath": "src/Illuminate/Http/Testing/FileFactory.php",
"language": "php",
"file_size": 2704,
"cut_index": 563,
"middle_length": 229
} |
s;
use Illuminate\Support\Traits\Macroable;
trait DelegatesToResource
{
use ForwardsCalls, Macroable {
__call as macroCall;
}
/**
* Get the value of the resource's route key.
*
* @return mixed
*/
public function getRouteKey()
{
return $this->resource->getRouteKe... | nding($value, $field = null)
{
throw new Exception('Resources may not be implicitly resolved from route bindings.');
}
/**
* Retrieve the model for a bound value.
*
* @param string $childType
* @param mixed $val | );
}
/**
* Retrieve the model for a bound value.
*
* @param mixed $value
* @param string|null $field
* @return void
*
* @throws \Exception
*/
public function resolveRouteBi | {
"filepath": "src/Illuminate/Http/Resources/DelegatesToResource.php",
"language": "php",
"file_size": 3373,
"cut_index": 614,
"middle_length": 229
} |
uminate\Http\Request;
class TrustHosts
{
/**
* The application instance.
*
* @var \Illuminate\Contracts\Foundation\Application
*/
protected $app;
/**
* The trusted hosts that have been configured to always be trusted.
*
* @var array<int, string>|(callable(): array<int, s... | $app;
}
/**
* Get the host patterns that should be trusted.
*
* @return array
*/
public function hosts()
{
if (is_null(static::$alwaysTrust)) {
return [$this->allSubdomainsOfApplicationUrl()];
| d static $subdomains;
/**
* Create a new middleware instance.
*
* @param \Illuminate\Contracts\Foundation\Application $app
*/
public function __construct(Application $app)
{
$this->app = | {
"filepath": "src/Illuminate/Http/Middleware/TrustHosts.php",
"language": "php",
"file_size": 3098,
"cut_index": 614,
"middle_length": 229
} |
use Illuminate\Http\Request;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
class JsonApiRequest extends Request
{
/**
* Cached sparse fieldset.
*/
protected ?array $cachedSparseFields = null;
/**
* Cached sparse included.
*/
protected ?array $cachedSparseIncluded... | parseFields[$key] ?? [];
}
/**
* Determine if a sparse fieldset was provided for the given resource type.
*/
public function hasSparseFieldset(string $key): bool
{
if (is_null($this->cachedSparseFields)) {
$th | is->cachedSparseFields = (new Collection($this->array('fields')))
->transform(fn ($fieldsets) => empty($fieldsets) ? [] : explode(',', $fieldsets))
->all();
}
return $this->cachedS | {
"filepath": "src/Illuminate/Http/Resources/JsonApi/JsonApiRequest.php",
"language": "php",
"file_size": 2649,
"cut_index": 563,
"middle_length": 229
} |
"12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" {{ $attributes }}>
<g clip-path="url(#clip0_14732_6211)">
<path d="M1.75 5.25V2.75C1.75 1.922 2.422 1.25 3.25 1.25H4.202C4.808 1.25 5.381 1.525 5.761 1.998L6.364 2.75H8.25C9.355 2.75 10.25 3.645 10.25 4.75V5.25" stroke="currentColor" st... | 0.859011 6.052 1.55901 5.25 2.46801 5.25Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
</g>
<defs>
<clipPath id="clip0_14732_6211">
<rect width="12" height="12" />
</clipPath>
</defs>
</svg | 10.751 1.39901 10.012 1.26401 9.021L0.982011 6.953C | {
"filepath": "src/Illuminate/Foundation/resources/exceptions/renderer/components/icons/folder-open.blade.php",
"language": "php",
"file_size": 845,
"cut_index": 535,
"middle_length": 52
} |
ring
*/
protected $signature = 'about {--only= : The section to display}
{--json : Output the information as JSON}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Display basic information about your application';
/**
... |
*
* @param \Illuminate\Support\Composer $composer
*/
public function __construct(Composer $composer)
{
parent::__construct();
$this->composer = $composer;
}
/**
* Execute the console command.
*
| atic $data = [];
/**
* The registered callables that add custom data to the command output.
*
* @var array
*/
protected static $customDataResolvers = [];
/**
* Create a new command instance. | {
"filepath": "src/Illuminate/Foundation/Console/AboutCommand.php",
"language": "php",
"file_size": 12896,
"cut_index": 921,
"middle_length": 229
} |
stem\Filesystem;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Process;
use Symfony\Component\Console\Attribute\AsCommand;
use function Illuminate\Support\artisan_binary;
use function Illuminate\Support\php_binary;
#[AsCommand(name: 'install:api')]
class ApiInstallCommand extends Command
{
use... | stead of Laravel Sanctum}
{--without-migration-prompt : Do not prompt to run pending migrations}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Create an API routes fil | composer=global : Absolute path to the Composer binary which should be used to install packages}
{--force : Overwrite any existing API routes file}
{--passport : Install Laravel Passport in | {
"filepath": "src/Illuminate/Foundation/Console/ApiInstallCommand.php",
"language": "php",
"file_size": 4971,
"cut_index": 614,
"middle_length": 229
} |
tion Laravel\Prompts\password;
use function Laravel\Prompts\select;
use function Laravel\Prompts\text;
#[AsCommand(name: 'install:broadcasting')]
class BroadcastingInstallCommand extends Command
{
use InteractsWithComposerPackages;
/**
* The name and signature of the console command.
*
* @var s... | ster}
{--pusher : Install Pusher as the default broadcaster}
{--ably : Install Ably as the default broadcaster}
{--without-node : Do not prompt to install Node dependencies}';
/**
* The | {--force : Overwrite any existing broadcasting routes file}
{--without-reverb : Do not prompt to install Laravel Reverb}
{--reverb : Install Laravel Reverb as the default broadca | {
"filepath": "src/Illuminate/Foundation/Console/BroadcastingInstallCommand.php",
"language": "php",
"file_size": 16413,
"cut_index": 921,
"middle_length": 229
} |
te\Foundation\Console;
use Illuminate\Console\GeneratorCommand;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputOption;
#[AsCommand(name: 'make:cast')]
class CastMakeCommand extends GeneratorCommand
{
/**
* The console command name.
*
* @var string
*... | etStub()
{
return $this->option('inbound')
? $this->resolveStubPath('/stubs/cast.inbound.stub')
: $this->resolveStubPath('/stubs/cast.stub');
}
/**
* Resolve the fully-qualified path to the stub.
*
|
/**
* The type of class being generated.
*
* @var string
*/
protected $type = 'Cast';
/**
* Get the stub file for the generator.
*
* @return string
*/
protected function g | {
"filepath": "src/Illuminate/Foundation/Console/CastMakeCommand.php",
"language": "php",
"file_size": 1879,
"cut_index": 537,
"middle_length": 229
} |
minate\Contracts\Broadcasting\Broadcaster;
use Illuminate\Support\Collection;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Terminal;
#[AsCommand(name: 'channel:list')]
class ChannelListCommand extends Command
{
/**
* The console command name.
*
* @var string
... | \Contracts\Broadcasting\Broadcaster $broadcaster
* @return void
*/
public function handle(Broadcaster $broadcaster)
{
$channels = $broadcaster->getChannels();
if (! $this->laravel->providerIsLoaded('App\Providers\Broadca | channels';
/**
* The terminal width resolver callback.
*
* @var \Closure|null
*/
protected static $terminalWidthResolver;
/**
* Execute the console command.
*
* @param \Illuminate | {
"filepath": "src/Illuminate/Foundation/Console/ChannelListCommand.php",
"language": "php",
"file_size": 4396,
"cut_index": 614,
"middle_length": 229
} |
te\Foundation\Console;
use Illuminate\Console\GeneratorCommand;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputOption;
#[AsCommand(name: 'make:channel')]
class ChannelMakeCommand extends GeneratorCommand
{
/**
* The console command name.
*
* @var string
... | */
protected function buildClass($name)
{
return str_replace(
['DummyUser', '{{ userModel }}'],
class_basename($this->userProviderModel()),
parent::buildClass($name)
);
}
/**
* Get | /**
* The type of class being generated.
*
* @var string
*/
protected $type = 'Channel';
/**
* Build the class with the given name.
*
* @param string $name
* @return string
| {
"filepath": "src/Illuminate/Foundation/Console/ChannelMakeCommand.php",
"language": "php",
"file_size": 1706,
"cut_index": 537,
"middle_length": 229
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.