validation-bugsnag-email
This commit is contained in:
		| @@ -32,8 +32,8 @@ trait HandlesAuthorization | ||||
|      * Deny with a HTTP status code. | ||||
|      * | ||||
|      * @param  int  $status | ||||
|      * @param  ?string  $message | ||||
|      * @param  ?int  $code | ||||
|      * @param  string|null  $message | ||||
|      * @param  int|null  $code | ||||
|      * @return \Illuminate\Auth\Access\Response | ||||
|      */ | ||||
|     public function denyWithStatus($status, $message = null, $code = null) | ||||
| @@ -44,8 +44,8 @@ trait HandlesAuthorization | ||||
|     /** | ||||
|      * Deny with a 404 HTTP status code. | ||||
|      * | ||||
|      * @param  ?string  $message | ||||
|      * @param  ?int  $code | ||||
|      * @param  string|null  $message | ||||
|      * @param  int|null  $code | ||||
|      * @return \Illuminate\Auth\Access\Response | ||||
|      */ | ||||
|     public function denyAsNotFound($message = null, $code = null) | ||||
|   | ||||
| @@ -23,7 +23,7 @@ class RedisBroadcaster extends Broadcaster | ||||
|     /** | ||||
|      * The Redis connection to use for broadcasting. | ||||
|      * | ||||
|      * @var ?string | ||||
|      * @var string|null | ||||
|      */ | ||||
|     protected $connection = null; | ||||
|  | ||||
|   | ||||
| @@ -719,7 +719,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl | ||||
|      * | ||||
|      * @param  string|int|array<array-key, string>  $value | ||||
|      * @param  string|null  $key | ||||
|      * @return static<int, mixed> | ||||
|      * @return static<array-key, mixed> | ||||
|      */ | ||||
|     public function pluck($value, $key = null) | ||||
|     { | ||||
| @@ -1646,7 +1646,7 @@ class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerabl | ||||
|     /** | ||||
|      * Count the number of items in the collection by a field or using a callback. | ||||
|      * | ||||
|      * @param  (callable(TValue, TKey): mixed)|string|null  $countBy | ||||
|      * @param  (callable(TValue, TKey): array-key)|string|null  $countBy | ||||
|      * @return static<array-key, int> | ||||
|      */ | ||||
|     public function countBy($countBy = null) | ||||
|   | ||||
| @@ -1168,7 +1168,7 @@ interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, | ||||
|     /** | ||||
|      * Count the number of items in the collection by a field or using a callback. | ||||
|      * | ||||
|      * @param  (callable(TValue, TKey): mixed)|string|null  $countBy | ||||
|      * @param  (callable(TValue, TKey): array-key)|string|null  $countBy | ||||
|      * @return static<array-key, int> | ||||
|      */ | ||||
|     public function countBy($countBy = null); | ||||
|   | ||||
| @@ -292,7 +292,7 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable | ||||
|     /** | ||||
|      * Count the number of items in the collection by a field or using a callback. | ||||
|      * | ||||
|      * @param  (callable(TValue, TKey): mixed)|string|null  $countBy | ||||
|      * @param  (callable(TValue, TKey): array-key)|string|null  $countBy | ||||
|      * @return static<array-key, int> | ||||
|      */ | ||||
|     public function countBy($countBy = null) | ||||
|   | ||||
| @@ -648,7 +648,25 @@ class Container implements ArrayAccess, ContainerContract | ||||
|      */ | ||||
|     public function call($callback, array $parameters = [], $defaultMethod = null) | ||||
|     { | ||||
|         return BoundMethod::call($this, $callback, $parameters, $defaultMethod); | ||||
|         $pushedToBuildStack = false; | ||||
|  | ||||
|         if (is_array($callback) && ! in_array( | ||||
|             $className = (is_string($callback[0]) ? $callback[0] : get_class($callback[0])), | ||||
|             $this->buildStack, | ||||
|             true | ||||
|         )) { | ||||
|             $this->buildStack[] = $className; | ||||
|  | ||||
|             $pushedToBuildStack = true; | ||||
|         } | ||||
|  | ||||
|         $result = BoundMethod::call($this, $callback, $parameters, $defaultMethod); | ||||
|  | ||||
|         if ($pushedToBuildStack) { | ||||
|             array_pop($this->buildStack); | ||||
|         } | ||||
|  | ||||
|         return $result; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -60,7 +60,7 @@ interface ResponseFactory | ||||
|     /** | ||||
|      * Create a new streamed response instance. | ||||
|      * | ||||
|      * @param  \Closure  $callback | ||||
|      * @param  callable  $callback | ||||
|      * @param  int  $status | ||||
|      * @param  array  $headers | ||||
|      * @return \Symfony\Component\HttpFoundation\StreamedResponse | ||||
| @@ -70,7 +70,7 @@ interface ResponseFactory | ||||
|     /** | ||||
|      * Create a new streamed response instance as a file download. | ||||
|      * | ||||
|      * @param  \Closure  $callback | ||||
|      * @param  callable  $callback | ||||
|      * @param  string|null  $name | ||||
|      * @param  array  $headers | ||||
|      * @param  string|null  $disposition | ||||
|   | ||||
| @@ -22,7 +22,7 @@ class CookieJar implements JarContract | ||||
|     /** | ||||
|      * The default domain (if specified). | ||||
|      * | ||||
|      * @var string | ||||
|      * @var string|null | ||||
|      */ | ||||
|     protected $domain; | ||||
|  | ||||
| @@ -135,7 +135,7 @@ class CookieJar implements JarContract | ||||
|     /** | ||||
|      * Queue a cookie to send with the next response. | ||||
|      * | ||||
|      * @param  array  $parameters | ||||
|      * @param  mixed  ...$parameters | ||||
|      * @return void | ||||
|      */ | ||||
|     public function queue(...$parameters) | ||||
| @@ -192,7 +192,7 @@ class CookieJar implements JarContract | ||||
|      * Get the path and domain, or the default values. | ||||
|      * | ||||
|      * @param  string  $path | ||||
|      * @param  string  $domain | ||||
|      * @param  string|null  $domain | ||||
|      * @param  bool|null  $secure | ||||
|      * @param  string|null  $sameSite | ||||
|      * @return array | ||||
| @@ -206,8 +206,8 @@ class CookieJar implements JarContract | ||||
|      * Set the default path and domain for the jar. | ||||
|      * | ||||
|      * @param  string  $path | ||||
|      * @param  string  $domain | ||||
|      * @param  bool  $secure | ||||
|      * @param  string|null  $domain | ||||
|      * @param  bool|null  $secure | ||||
|      * @param  string|null  $sameSite | ||||
|      * @return $this | ||||
|      */ | ||||
|   | ||||
| @@ -18,7 +18,7 @@ class MigrateMakeCommand extends BaseCommand | ||||
|         {--table= : The table to migrate} | ||||
|         {--path= : The location where the migration file should be created} | ||||
|         {--realpath : Indicate any provided migration file paths are pre-resolved absolute paths} | ||||
|         {--fullpath : Output the full path of the migration}'; | ||||
|         {--fullpath : Output the full path of the migration (Deprecated)}'; | ||||
|  | ||||
|     /** | ||||
|      * The console command description. | ||||
| @@ -110,10 +110,6 @@ class MigrateMakeCommand extends BaseCommand | ||||
|             $name, $this->getMigrationPath(), $table, $create | ||||
|         ); | ||||
|  | ||||
|         if (! $this->option('fullpath')) { | ||||
|             $file = pathinfo($file, PATHINFO_FILENAME); | ||||
|         } | ||||
|  | ||||
|         $this->components->info(sprintf('Migration [%s] created successfully.', $file)); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -525,6 +525,28 @@ class Collection extends BaseCollection implements QueueableCollection | ||||
|         return $this->each->makeVisible($attributes); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Set the visible attributes across the entire collection. | ||||
|      * | ||||
|      * @param  array<int, string>  $visible | ||||
|      * @return $this | ||||
|      */ | ||||
|     public function setVisible($visible) | ||||
|     { | ||||
|         return $this->each->setVisible($visible); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Set the hidden attributes across the entire collection. | ||||
|      * | ||||
|      * @param  array<int, string>  $hidden | ||||
|      * @return $this | ||||
|      */ | ||||
|     public function setHidden($hidden) | ||||
|     { | ||||
|         return $this->each->setHidden($hidden); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Append an attribute across the entire collection. | ||||
|      * | ||||
| @@ -560,38 +582,14 @@ class Collection extends BaseCollection implements QueueableCollection | ||||
|      */ | ||||
|  | ||||
|     /** | ||||
|      * Get an array with the values of a given key. | ||||
|      * Count the number of items in the collection by a field or using a callback. | ||||
|      * | ||||
|      * @param  string|array<array-key, string>  $value | ||||
|      * @param  string|null  $key | ||||
|      * @return \Illuminate\Support\Collection<int, mixed> | ||||
|      * @param  (callable(TValue, TKey): array-key)|string|null  $countBy | ||||
|      * @return \Illuminate\Support\Collection<array-key, int> | ||||
|      */ | ||||
|     public function pluck($value, $key = null) | ||||
|     public function countBy($countBy = null) | ||||
|     { | ||||
|         return $this->toBase()->pluck($value, $key); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get the keys of the collection items. | ||||
|      * | ||||
|      * @return \Illuminate\Support\Collection<int, TKey> | ||||
|      */ | ||||
|     public function keys() | ||||
|     { | ||||
|         return $this->toBase()->keys(); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Zip the collection together with one or more arrays. | ||||
|      * | ||||
|      * @template TZipValue | ||||
|      * | ||||
|      * @param  \Illuminate\Contracts\Support\Arrayable<array-key, TZipValue>|iterable<array-key, TZipValue>  ...$items | ||||
|      * @return \Illuminate\Support\Collection<int, \Illuminate\Support\Collection<int, TModel|TZipValue>> | ||||
|      */ | ||||
|     public function zip($items) | ||||
|     { | ||||
|         return $this->toBase()->zip(...func_get_args()); | ||||
|         return $this->toBase()->countBy($countBy); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @@ -625,6 +623,16 @@ class Collection extends BaseCollection implements QueueableCollection | ||||
|         return $this->toBase()->flip(); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get the keys of the collection items. | ||||
|      * | ||||
|      * @return \Illuminate\Support\Collection<int, TKey> | ||||
|      */ | ||||
|     public function keys() | ||||
|     { | ||||
|         return $this->toBase()->keys(); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Pad collection to the specified length with a value. | ||||
|      * | ||||
| @@ -639,6 +647,31 @@ class Collection extends BaseCollection implements QueueableCollection | ||||
|         return $this->toBase()->pad($size, $value); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get an array with the values of a given key. | ||||
|      * | ||||
|      * @param  string|array<array-key, string>  $value | ||||
|      * @param  string|null  $key | ||||
|      * @return \Illuminate\Support\Collection<array-key, mixed> | ||||
|      */ | ||||
|     public function pluck($value, $key = null) | ||||
|     { | ||||
|         return $this->toBase()->pluck($value, $key); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Zip the collection together with one or more arrays. | ||||
|      * | ||||
|      * @template TZipValue | ||||
|      * | ||||
|      * @param  \Illuminate\Contracts\Support\Arrayable<array-key, TZipValue>|iterable<array-key, TZipValue>  ...$items | ||||
|      * @return \Illuminate\Support\Collection<int, \Illuminate\Support\Collection<int, TModel|TZipValue>> | ||||
|      */ | ||||
|     public function zip($items) | ||||
|     { | ||||
|         return $this->toBase()->zip(...func_get_args()); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get the comparison function to detect duplicates. | ||||
|      * | ||||
|   | ||||
| @@ -3,6 +3,9 @@ | ||||
| namespace Illuminate\Database\Eloquent\Concerns; | ||||
|  | ||||
| use BackedEnum; | ||||
| use Brick\Math\BigDecimal; | ||||
| use Brick\Math\Exception\MathException as BrickMathException; | ||||
| use Brick\Math\RoundingMode; | ||||
| use Carbon\CarbonImmutable; | ||||
| use Carbon\CarbonInterface; | ||||
| use DateTimeImmutable; | ||||
| @@ -23,6 +26,7 @@ use Illuminate\Database\LazyLoadingViolationException; | ||||
| use Illuminate\Support\Arr; | ||||
| use Illuminate\Support\Carbon; | ||||
| use Illuminate\Support\Collection as BaseCollection; | ||||
| use Illuminate\Support\Exceptions\MathException; | ||||
| use Illuminate\Support\Facades\Crypt; | ||||
| use Illuminate\Support\Facades\Date; | ||||
| use Illuminate\Support\Str; | ||||
| @@ -31,8 +35,6 @@ use LogicException; | ||||
| use ReflectionClass; | ||||
| use ReflectionMethod; | ||||
| use ReflectionNamedType; | ||||
| use RuntimeException; | ||||
| use TypeError; | ||||
|  | ||||
| trait HasAttributes | ||||
| { | ||||
| @@ -179,7 +181,7 @@ trait HasAttributes | ||||
|     /** | ||||
|      * The encrypter instance that is used to encrypt attributes. | ||||
|      * | ||||
|      * @var \Illuminate\Contracts\Encryption\Encrypter | ||||
|      * @var \Illuminate\Contracts\Encryption\Encrypter|null | ||||
|      */ | ||||
|     public static $encrypter; | ||||
|  | ||||
| @@ -1070,6 +1072,8 @@ trait HasAttributes | ||||
|         } else { | ||||
|             unset($this->attributeCastCache[$key]); | ||||
|         } | ||||
|  | ||||
|         return $this; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @@ -1287,7 +1291,7 @@ trait HasAttributes | ||||
|     /** | ||||
|      * Set the encrypter instance that will be used to encrypt attributes. | ||||
|      * | ||||
|      * @param  \Illuminate\Contracts\Encryption\Encrypter  $encrypter | ||||
|      * @param  \Illuminate\Contracts\Encryption\Encrypter|null  $encrypter | ||||
|      * @return void | ||||
|      */ | ||||
|     public static function encryptUsing($encrypter) | ||||
| @@ -1320,21 +1324,11 @@ trait HasAttributes | ||||
|      */ | ||||
|     protected function asDecimal($value, $decimals) | ||||
|     { | ||||
|         if (extension_loaded('bcmath')) { | ||||
|             return bcadd($value, 0, $decimals); | ||||
|         try { | ||||
|             return (string) BigDecimal::of($value)->toScale($decimals, RoundingMode::HALF_UP); | ||||
|         } catch (BrickMathException $e) { | ||||
|             throw new MathException('Unable to cast value to a decimal.', previous: $e); | ||||
|         } | ||||
|  | ||||
|         if (! is_numeric($value)) { | ||||
|             throw new TypeError('$value must be numeric.'); | ||||
|         } | ||||
|  | ||||
|         if (is_string($value) && Str::contains($value, 'e', true)) { | ||||
|             throw new RuntimeException('The "decimal" model cast is unable to handle string based floats with exponents.'); | ||||
|         } | ||||
|  | ||||
|         [$int, $fraction] = explode('.', $value) + [1 => '']; | ||||
|  | ||||
|         return Str::of($int)->padLeft('1', '0').'.'.Str::of($fraction)->limit($decimals, '')->padRight($decimals, '0'); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -549,7 +549,7 @@ class HasManyThrough extends Relation | ||||
|     /** | ||||
|      * Get a generator for the given query. | ||||
|      * | ||||
|      * @return \Generator | ||||
|      * @return \Illuminate\Support\LazyCollection | ||||
|      */ | ||||
|     public function cursor() | ||||
|     { | ||||
|   | ||||
| @@ -1094,6 +1094,8 @@ class Builder implements BuilderContract | ||||
|             $values = $values->toArray(); | ||||
|         } | ||||
|  | ||||
|         $values = Arr::flatten($values); | ||||
|  | ||||
|         foreach ($values as &$value) { | ||||
|             $value = (int) $value; | ||||
|         } | ||||
| @@ -3408,11 +3410,31 @@ class Builder implements BuilderContract | ||||
|             throw new InvalidArgumentException('Non-numeric value passed to increment method.'); | ||||
|         } | ||||
|  | ||||
|         $wrapped = $this->grammar->wrap($column); | ||||
|         return $this->incrementEach([$column => $amount], $extra); | ||||
|     } | ||||
|  | ||||
|         $columns = array_merge([$column => $this->raw("$wrapped + $amount")], $extra); | ||||
|     /** | ||||
|      * Increment the given column's values by the given amounts. | ||||
|      * | ||||
|      * @param  array<string, float|int|numeric-string>  $columns | ||||
|      * @param  array<string, mixed>  $extra | ||||
|      * @return int | ||||
|      * | ||||
|      * @throws \InvalidArgumentException | ||||
|      */ | ||||
|     public function incrementEach(array $columns, array $extra = []) | ||||
|     { | ||||
|         foreach ($columns as $column => $amount) { | ||||
|             if (! is_numeric($amount)) { | ||||
|                 throw new InvalidArgumentException("Non-numeric value passed as increment amount for column: '$column'."); | ||||
|             } elseif (! is_string($column)) { | ||||
|                 throw new InvalidArgumentException('Non-associative array passed to incrementEach method.'); | ||||
|             } | ||||
|  | ||||
|         return $this->update($columns); | ||||
|             $columns[$column] = $this->raw("{$this->grammar->wrap($column)} + $amount"); | ||||
|         } | ||||
|  | ||||
|         return $this->update(array_merge($columns, $extra)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @@ -3431,11 +3453,31 @@ class Builder implements BuilderContract | ||||
|             throw new InvalidArgumentException('Non-numeric value passed to decrement method.'); | ||||
|         } | ||||
|  | ||||
|         $wrapped = $this->grammar->wrap($column); | ||||
|         return $this->decrementEach([$column => $amount], $extra); | ||||
|     } | ||||
|  | ||||
|         $columns = array_merge([$column => $this->raw("$wrapped - $amount")], $extra); | ||||
|     /** | ||||
|      * Decrement the given column's values by the given amounts. | ||||
|      * | ||||
|      * @param  array<string, float|int|numeric-string>  $columns | ||||
|      * @param  array<string, mixed>  $extra | ||||
|      * @return int | ||||
|      * | ||||
|      * @throws \InvalidArgumentException | ||||
|      */ | ||||
|     public function decrementEach(array $columns, array $extra = []) | ||||
|     { | ||||
|         foreach ($columns as $column => $amount) { | ||||
|             if (! is_numeric($amount)) { | ||||
|                 throw new InvalidArgumentException("Non-numeric value passed as decrement amount for column: '$column'."); | ||||
|             } elseif (! is_string($column)) { | ||||
|                 throw new InvalidArgumentException('Non-associative array passed to decrementEach method.'); | ||||
|             } | ||||
|  | ||||
|         return $this->update($columns); | ||||
|             $columns[$column] = $this->raw("{$this->grammar->wrap($column)} - $amount"); | ||||
|         } | ||||
|  | ||||
|         return $this->update(array_merge($columns, $extra)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -21,7 +21,7 @@ class SQLiteDatabaseDoesNotExistException extends InvalidArgumentException | ||||
|      */ | ||||
|     public function __construct($path) | ||||
|     { | ||||
|         parent::__construct("Database ({$path}) does not exist."); | ||||
|         parent::__construct("Database file at path [{$path}] does not exist. Ensure this is an absolute path to the database."); | ||||
|  | ||||
|         $this->path = $path; | ||||
|     } | ||||
|   | ||||
| @@ -215,7 +215,17 @@ class Blueprint | ||||
|                 // index method can be called without a name and it will generate one. | ||||
|                 if ($column->{$index} === true) { | ||||
|                     $this->{$index}($column->name); | ||||
|                     $column->{$index} = false; | ||||
|                     $column->{$index} = null; | ||||
|  | ||||
|                     continue 2; | ||||
|                 } | ||||
|  | ||||
|                 // If the index has been specified on the given column, but it equals false | ||||
|                 // and the column is supposed to be changed, we will call the drop index | ||||
|                 // method with an array of column to drop it by its conventional name. | ||||
|                 elseif ($column->{$index} === false && $column->change) { | ||||
|                     $this->{'drop'.ucfirst($index)}([$column->name]); | ||||
|                     $column->{$index} = null; | ||||
|  | ||||
|                     continue 2; | ||||
|                 } | ||||
| @@ -225,7 +235,7 @@ class Blueprint | ||||
|                 // the index since the developer specified the explicit name for this. | ||||
|                 elseif (isset($column->{$index})) { | ||||
|                     $this->{$index}($column->name, $column->{$index}); | ||||
|                     $column->{$index} = false; | ||||
|                     $column->{$index} = null; | ||||
|  | ||||
|                     continue 2; | ||||
|                 } | ||||
|   | ||||
| @@ -411,6 +411,23 @@ class Builder | ||||
|         ); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Disable foreign key constraints during the execution of a callback. | ||||
|      * | ||||
|      * @param  \Closure  $callback | ||||
|      * @return mixed | ||||
|      */ | ||||
|     public function withoutForeignKeyConstraints(Closure $callback) | ||||
|     { | ||||
|         $this->disableForeignKeyConstraints(); | ||||
|  | ||||
|         $result = $callback(); | ||||
|  | ||||
|         $this->enableForeignKeyConstraints(); | ||||
|  | ||||
|         return $result; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Execute the blueprint to build / modify the table. | ||||
|      * | ||||
|   | ||||
| @@ -231,9 +231,11 @@ class MySqlGrammar extends Grammar | ||||
|      */ | ||||
|     public function compilePrimary(Blueprint $blueprint, Fluent $command) | ||||
|     { | ||||
|         $command->name(null); | ||||
|  | ||||
|         return $this->compileKey($blueprint, $command, 'primary key'); | ||||
|         return sprintf('alter table %s add primary key %s(%s)', | ||||
|             $this->wrapTable($blueprint), | ||||
|             $command->algorithm ? 'using '.$command->algorithm : '', | ||||
|             $this->columnize($command->columns) | ||||
|         ); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -4,7 +4,7 @@ namespace Illuminate\Database; | ||||
|  | ||||
| use Illuminate\Console\Command; | ||||
| use Illuminate\Console\View\Components\TwoColumnDetail; | ||||
| use Illuminate\Container\Container; | ||||
| use Illuminate\Contracts\Container\Container; | ||||
| use Illuminate\Database\Console\Seeds\WithoutModelEvents; | ||||
| use Illuminate\Support\Arr; | ||||
| use InvalidArgumentException; | ||||
| @@ -14,7 +14,7 @@ abstract class Seeder | ||||
|     /** | ||||
|      * The container instance. | ||||
|      * | ||||
|      * @var \Illuminate\Container\Container | ||||
|      * @var \Illuminate\Contracts\Container\Container | ||||
|      */ | ||||
|     protected $container; | ||||
|  | ||||
| @@ -143,7 +143,7 @@ abstract class Seeder | ||||
|     /** | ||||
|      * Set the IoC container instance. | ||||
|      * | ||||
|      * @param  \Illuminate\Container\Container  $container | ||||
|      * @param  \Illuminate\Contracts\Container\Container  $container | ||||
|      * @return $this | ||||
|      */ | ||||
|     public function setContainer(Container $container) | ||||
|   | ||||
| @@ -23,6 +23,7 @@ use League\Flysystem\Visibility; | ||||
|  | ||||
| /** | ||||
|  * @mixin \Illuminate\Contracts\Filesystem\Filesystem | ||||
|  * @mixin \Illuminate\Filesystem\FilesystemAdapter | ||||
|  */ | ||||
| class FilesystemManager implements FactoryContract | ||||
| { | ||||
|   | ||||
| @@ -38,7 +38,7 @@ class Application extends Container implements ApplicationContract, CachesConfig | ||||
|      * | ||||
|      * @var string | ||||
|      */ | ||||
|     const VERSION = '9.46.0'; | ||||
|     const VERSION = '9.48.0'; | ||||
|  | ||||
|     /** | ||||
|      * The base path for the Laravel installation. | ||||
|   | ||||
| @@ -86,21 +86,6 @@ class DocsCommand extends Command | ||||
|      */ | ||||
|     protected $systemOsFamily = PHP_OS_FAMILY; | ||||
|  | ||||
|     /** | ||||
|      * Create a new command instance. | ||||
|      * | ||||
|      * @param  \Illuminate\Http\Client\Factory  $http | ||||
|      * @param  \Illuminate\Contracts\Cache\Repository  $cache | ||||
|      * @return void | ||||
|      */ | ||||
|     public function __construct(Http $http, Cache $cache) | ||||
|     { | ||||
|         parent::__construct(); | ||||
|  | ||||
|         $this->http = $http; | ||||
|         $this->cache = $cache; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Configure the current command. | ||||
|      * | ||||
| @@ -118,10 +103,15 @@ class DocsCommand extends Command | ||||
|     /** | ||||
|      * Execute the console command. | ||||
|      * | ||||
|      * @param  \Illuminate\Http\Client\Factory  $http | ||||
|      * @param  \Illuminate\Contracts\Cache\Repository  $cache | ||||
|      * @return int | ||||
|      */ | ||||
|     public function handle() | ||||
|     public function handle(Http $http, Cache $cache) | ||||
|     { | ||||
|         $this->http = $http; | ||||
|         $this->cache = $cache; | ||||
|  | ||||
|         try { | ||||
|             $this->openUrl(); | ||||
|         } catch (ProcessFailedException $e) { | ||||
| @@ -190,7 +180,7 @@ class DocsCommand extends Command | ||||
|     /** | ||||
|      * Determine the page to open. | ||||
|      * | ||||
|      * @return ?string | ||||
|      * @return string|null | ||||
|      */ | ||||
|     protected function resolvePage() | ||||
|     { | ||||
| @@ -216,7 +206,7 @@ class DocsCommand extends Command | ||||
|     /** | ||||
|      * Ask the user which page they would like to open. | ||||
|      * | ||||
|      * @return ?string | ||||
|      * @return string|null | ||||
|      */ | ||||
|     protected function askForPage() | ||||
|     { | ||||
| @@ -226,7 +216,7 @@ class DocsCommand extends Command | ||||
|     /** | ||||
|      * Ask the user which page they would like to open via a custom strategy. | ||||
|      * | ||||
|      * @return ?string | ||||
|      * @return string|null | ||||
|      */ | ||||
|     protected function askForPageViaCustomStrategy() | ||||
|     { | ||||
| @@ -246,7 +236,7 @@ class DocsCommand extends Command | ||||
|     /** | ||||
|      * Ask the user which page they would like to open using autocomplete. | ||||
|      * | ||||
|      * @return ?string | ||||
|      * @return string|null | ||||
|      */ | ||||
|     protected function askForPageViaAutocomplete() | ||||
|     { | ||||
| @@ -267,7 +257,7 @@ class DocsCommand extends Command | ||||
|     /** | ||||
|      * Guess the page the user is attempting to open. | ||||
|      * | ||||
|      * @return ?string | ||||
|      * @return string|null | ||||
|      */ | ||||
|     protected function guessPage() | ||||
|     { | ||||
| @@ -293,7 +283,7 @@ class DocsCommand extends Command | ||||
|      * The section the user specifically asked to open. | ||||
|      * | ||||
|      * @param  string  $page | ||||
|      * @return ?string | ||||
|      * @return string|null | ||||
|      */ | ||||
|     protected function section($page) | ||||
|     { | ||||
| @@ -316,7 +306,7 @@ class DocsCommand extends Command | ||||
|      * Guess the section the user is attempting to open. | ||||
|      * | ||||
|      * @param  string  $page | ||||
|      * @return ?string | ||||
|      * @return string|null | ||||
|      */ | ||||
|     protected function guessSection($page) | ||||
|     { | ||||
|   | ||||
| @@ -218,7 +218,7 @@ class ShowModelCommand extends DatabaseInspectionCommand | ||||
|                 $file->seek($method->getStartLine() - 1); | ||||
|                 $code = ''; | ||||
|                 while ($file->key() < $method->getEndLine()) { | ||||
|                     $code .= $file->current(); | ||||
|                     $code .= trim($file->current()); | ||||
|                     $file->next(); | ||||
|                 } | ||||
|  | ||||
|   | ||||
| @@ -4,6 +4,7 @@ namespace Illuminate\Foundation\Console; | ||||
|  | ||||
| use Illuminate\Console\Command; | ||||
| use Illuminate\Filesystem\Filesystem; | ||||
| use Illuminate\Foundation\Events\PublishingStubs; | ||||
| use Symfony\Component\Console\Attribute\AsCommand; | ||||
|  | ||||
| #[AsCommand(name: 'stub:publish')] | ||||
| @@ -47,53 +48,57 @@ class StubPublishCommand extends Command | ||||
|             (new Filesystem)->makeDirectory($stubsPath); | ||||
|         } | ||||
|  | ||||
|         $files = [ | ||||
|             __DIR__.'/stubs/cast.inbound.stub' => $stubsPath.'/cast.inbound.stub', | ||||
|             __DIR__.'/stubs/cast.stub' => $stubsPath.'/cast.stub', | ||||
|             __DIR__.'/stubs/console.stub' => $stubsPath.'/console.stub', | ||||
|             __DIR__.'/stubs/event.stub' => $stubsPath.'/event.stub', | ||||
|             __DIR__.'/stubs/job.queued.stub' => $stubsPath.'/job.queued.stub', | ||||
|             __DIR__.'/stubs/job.stub' => $stubsPath.'/job.stub', | ||||
|             __DIR__.'/stubs/mail.stub' => $stubsPath.'/mail.stub', | ||||
|             __DIR__.'/stubs/markdown-mail.stub' => $stubsPath.'/markdown-mail.stub', | ||||
|             __DIR__.'/stubs/markdown-notification.stub' => $stubsPath.'/markdown-notification.stub', | ||||
|             __DIR__.'/stubs/model.pivot.stub' => $stubsPath.'/model.pivot.stub', | ||||
|             __DIR__.'/stubs/model.stub' => $stubsPath.'/model.stub', | ||||
|             __DIR__.'/stubs/notification.stub' => $stubsPath.'/notification.stub', | ||||
|             __DIR__.'/stubs/observer.plain.stub' => $stubsPath.'/observer.plain.stub', | ||||
|             __DIR__.'/stubs/observer.stub' => $stubsPath.'/observer.stub', | ||||
|             __DIR__.'/stubs/policy.plain.stub' => $stubsPath.'/policy.plain.stub', | ||||
|             __DIR__.'/stubs/policy.stub' => $stubsPath.'/policy.stub', | ||||
|             __DIR__.'/stubs/provider.stub' => $stubsPath.'/provider.stub', | ||||
|             __DIR__.'/stubs/request.stub' => $stubsPath.'/request.stub', | ||||
|             __DIR__.'/stubs/resource.stub' => $stubsPath.'/resource.stub', | ||||
|             __DIR__.'/stubs/resource-collection.stub' => $stubsPath.'/resource-collection.stub', | ||||
|             __DIR__.'/stubs/rule.stub' => $stubsPath.'/rule.stub', | ||||
|             __DIR__.'/stubs/scope.stub' => $stubsPath.'/scope.stub', | ||||
|             __DIR__.'/stubs/test.stub' => $stubsPath.'/test.stub', | ||||
|             __DIR__.'/stubs/test.unit.stub' => $stubsPath.'/test.unit.stub', | ||||
|             __DIR__.'/stubs/view-component.stub' => $stubsPath.'/view-component.stub', | ||||
|             realpath(__DIR__.'/../../Database/Console/Factories/stubs/factory.stub') => $stubsPath.'/factory.stub', | ||||
|             realpath(__DIR__.'/../../Database/Console/Seeds/stubs/seeder.stub') => $stubsPath.'/seeder.stub', | ||||
|             realpath(__DIR__.'/../../Database/Migrations/stubs/migration.create.stub') => $stubsPath.'/migration.create.stub', | ||||
|             realpath(__DIR__.'/../../Database/Migrations/stubs/migration.stub') => $stubsPath.'/migration.stub', | ||||
|             realpath(__DIR__.'/../../Database/Migrations/stubs/migration.update.stub') => $stubsPath.'/migration.update.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.api.stub') => $stubsPath.'/controller.api.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.invokable.stub') => $stubsPath.'/controller.invokable.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.model.api.stub') => $stubsPath.'/controller.model.api.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.model.stub') => $stubsPath.'/controller.model.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.nested.api.stub') => $stubsPath.'/controller.nested.api.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.nested.singleton.api.stub') => $stubsPath.'/controller.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.nested.singleton.stub') => $stubsPath.'/controller.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.nested.stub') => $stubsPath.'/controller.nested.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.plain.stub') => $stubsPath.'/controller.plain.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.singleton.api.stub') => $stubsPath.'/controller.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.singleton.stub') => $stubsPath.'/controller.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.stub') => $stubsPath.'/controller.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/middleware.stub') => $stubsPath.'/middleware.stub', | ||||
|         $stubs = [ | ||||
|             __DIR__.'/stubs/cast.inbound.stub' => 'cast.inbound.stub', | ||||
|             __DIR__.'/stubs/cast.stub' => 'cast.stub', | ||||
|             __DIR__.'/stubs/console.stub' => 'console.stub', | ||||
|             __DIR__.'/stubs/event.stub' => 'event.stub', | ||||
|             __DIR__.'/stubs/job.queued.stub' => 'job.queued.stub', | ||||
|             __DIR__.'/stubs/job.stub' => 'job.stub', | ||||
|             __DIR__.'/stubs/mail.stub' => 'mail.stub', | ||||
|             __DIR__.'/stubs/markdown-mail.stub' => 'markdown-mail.stub', | ||||
|             __DIR__.'/stubs/markdown-notification.stub' => 'markdown-notification.stub', | ||||
|             __DIR__.'/stubs/model.pivot.stub' => 'model.pivot.stub', | ||||
|             __DIR__.'/stubs/model.stub' => 'model.stub', | ||||
|             __DIR__.'/stubs/notification.stub' => 'notification.stub', | ||||
|             __DIR__.'/stubs/observer.plain.stub' => 'observer.plain.stub', | ||||
|             __DIR__.'/stubs/observer.stub' => 'observer.stub', | ||||
|             __DIR__.'/stubs/policy.plain.stub' => 'policy.plain.stub', | ||||
|             __DIR__.'/stubs/policy.stub' => 'policy.stub', | ||||
|             __DIR__.'/stubs/provider.stub' => 'provider.stub', | ||||
|             __DIR__.'/stubs/request.stub' => 'request.stub', | ||||
|             __DIR__.'/stubs/resource.stub' => 'resource.stub', | ||||
|             __DIR__.'/stubs/resource-collection.stub' => 'resource-collection.stub', | ||||
|             __DIR__.'/stubs/rule.stub' => 'rule.stub', | ||||
|             __DIR__.'/stubs/scope.stub' => 'scope.stub', | ||||
|             __DIR__.'/stubs/test.stub' => 'test.stub', | ||||
|             __DIR__.'/stubs/test.unit.stub' => 'test.unit.stub', | ||||
|             __DIR__.'/stubs/view-component.stub' => 'view-component.stub', | ||||
|             realpath(__DIR__.'/../../Database/Console/Factories/stubs/factory.stub') => 'factory.stub', | ||||
|             realpath(__DIR__.'/../../Database/Console/Seeds/stubs/seeder.stub') => 'seeder.stub', | ||||
|             realpath(__DIR__.'/../../Database/Migrations/stubs/migration.create.stub') => 'migration.create.stub', | ||||
|             realpath(__DIR__.'/../../Database/Migrations/stubs/migration.stub') => 'migration.stub', | ||||
|             realpath(__DIR__.'/../../Database/Migrations/stubs/migration.update.stub') => 'migration.update.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.api.stub') => 'controller.api.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.invokable.stub') => 'controller.invokable.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.model.api.stub') => 'controller.model.api.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.model.stub') => 'controller.model.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.nested.api.stub') => 'controller.nested.api.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.nested.singleton.api.stub') => 'controller.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.nested.singleton.stub') => 'controller.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.nested.stub') => 'controller.nested.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.plain.stub') => 'controller.plain.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.singleton.api.stub') => 'controller.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.singleton.stub') => 'controller.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/controller.stub') => 'controller.stub', | ||||
|             realpath(__DIR__.'/../../Routing/Console/stubs/middleware.stub') => 'middleware.stub', | ||||
|         ]; | ||||
|  | ||||
|         foreach ($files as $from => $to) { | ||||
|         $this->laravel['events']->dispatch($event = new PublishingStubs($stubs)); | ||||
|  | ||||
|         foreach ($event->stubs as $from => $to) { | ||||
|             $to = $stubsPath.DIRECTORY_SEPARATOR.ltrim($to, DIRECTORY_SEPARATOR); | ||||
|  | ||||
|             if ((! $this->option('existing') && (! file_exists($to) || $this->option('force'))) | ||||
|                 || ($this->option('existing') && file_exists($to))) { | ||||
|                 file_put_contents($to, file_get_contents($from)); | ||||
|   | ||||
							
								
								
									
										40
									
								
								vendor/laravel/framework/src/Illuminate/Foundation/Events/PublishingStubs.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								vendor/laravel/framework/src/Illuminate/Foundation/Events/PublishingStubs.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,40 @@ | ||||
| <?php | ||||
|  | ||||
| namespace Illuminate\Foundation\Events; | ||||
|  | ||||
| class PublishingStubs | ||||
| { | ||||
|     use Dispatchable; | ||||
|  | ||||
|     /** | ||||
|      * The stubs being published. | ||||
|      * | ||||
|      * @var array | ||||
|      */ | ||||
|     public $stubs = []; | ||||
|  | ||||
|     /** | ||||
|      * Create a new event instance. | ||||
|      * | ||||
|      * @param  array  $stubs | ||||
|      * @return void | ||||
|      */ | ||||
|     public function __construct(array $stubs) | ||||
|     { | ||||
|         $this->stubs = $stubs; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Add a new stub to be published. | ||||
|      * | ||||
|      * @param  string  $path | ||||
|      * @param  string  $name | ||||
|      * @return $this | ||||
|      */ | ||||
|     public function add(string $path, string $name) | ||||
|     { | ||||
|         $this->stubs[$path] = $name; | ||||
|  | ||||
|         return $this; | ||||
|     } | ||||
| } | ||||
							
								
								
									
										5
									
								
								vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/402.blade.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/views/402.blade.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| @extends('errors::minimal') | ||||
|  | ||||
| @section('title', __('Payment Required')) | ||||
| @section('code', '402') | ||||
| @section('message', __('Payment Required')) | ||||
| @@ -216,7 +216,7 @@ class FormRequest extends Request implements ValidatesWhenResolved | ||||
|     /** | ||||
|      * Get the validated data from the request. | ||||
|      * | ||||
|      * @param  string|null  $key | ||||
|      * @param  array|int|string|null  $key | ||||
|      * @param  mixed  $default | ||||
|      * @return mixed | ||||
|      */ | ||||
|   | ||||
| @@ -109,6 +109,18 @@ trait MakesHttpRequests | ||||
|         return $this->withHeader('Authorization', $type.' '.$token); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Add a basic authentication header to the request with the given credentials. | ||||
|      * | ||||
|      * @param  string  $username | ||||
|      * @param  string  $password | ||||
|      * @return $this | ||||
|      */ | ||||
|     public function withBasicAuth(string $username, string $password) | ||||
|     { | ||||
|         return $this->withToken(base64_encode("$username:$password"), 'Basic'); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Remove the authorization token from the request. | ||||
|      * | ||||
|   | ||||
| @@ -113,7 +113,7 @@ class Vite implements Htmlable | ||||
|     /** | ||||
|      * Generate or set a Content Security Policy nonce to apply to all generated tags. | ||||
|      * | ||||
|      * @param  ?string  $nonce | ||||
|      * @param  string|null  $nonce | ||||
|      * @return string | ||||
|      */ | ||||
|     public function useCspNonce($nonce = null) | ||||
| @@ -233,7 +233,7 @@ class Vite implements Htmlable | ||||
|     /** | ||||
|      * Use the given callback to resolve attributes for preload tags. | ||||
|      * | ||||
|      * @param  (callable(string, string, ?array, ?array): array|false)|array|false  $attributes | ||||
|      * @param  (callable(string, string, ?array, ?array): (array|false))|array|false  $attributes | ||||
|      * @return $this | ||||
|      */ | ||||
|     public function usePreloadTagAttributes($attributes) | ||||
|   | ||||
| @@ -456,12 +456,16 @@ if (! function_exists('fake') && class_exists(\Faker\Factory::class)) { | ||||
|     /** | ||||
|      * Get a faker instance. | ||||
|      * | ||||
|      * @param  ?string  $locale | ||||
|      * @param  string|null  $locale | ||||
|      * @return \Faker\Generator | ||||
|      */ | ||||
|     function fake($locale = null) | ||||
|     { | ||||
|         $locale ??= app('config')->get('app.faker_locale') ?? 'en_US'; | ||||
|         if (app()->bound('config')) { | ||||
|             $locale ??= app('config')->get('app.faker_locale'); | ||||
|         } | ||||
|  | ||||
|         $locale ??= 'en_US'; | ||||
|  | ||||
|         $abstract = \Faker\Generator::class.':'.$locale; | ||||
|  | ||||
|   | ||||
| @@ -87,7 +87,7 @@ class PendingRequest | ||||
|     /** | ||||
|      * The transfer stats for the request. | ||||
|      * | ||||
|      * \GuzzleHttp\TransferStats | ||||
|      * @var \GuzzleHttp\TransferStats | ||||
|      */ | ||||
|     protected $transferStats; | ||||
|  | ||||
|   | ||||
| @@ -204,6 +204,16 @@ class Response implements ArrayAccess | ||||
|         return $this->status() === 403; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Determine if the response was a 404 "Not Found" response. | ||||
|      * | ||||
|      * @return bool | ||||
|      */ | ||||
|     public function notFound() | ||||
|     { | ||||
|         return $this->status() === 404; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Determine if the response indicates a client or server error occurred. | ||||
|      * | ||||
|   | ||||
| @@ -13,6 +13,7 @@ use Illuminate\Support\Arr; | ||||
| use Illuminate\Support\Str; | ||||
| use InvalidArgumentException; | ||||
| use Psr\Log\LoggerInterface; | ||||
| use Symfony\Component\HttpClient\HttpClient; | ||||
| use Symfony\Component\Mailer\Bridge\Mailgun\Transport\MailgunTransportFactory; | ||||
| use Symfony\Component\Mailer\Bridge\Postmark\Transport\PostmarkTransportFactory; | ||||
| use Symfony\Component\Mailer\Transport\Dsn; | ||||
| @@ -223,7 +224,7 @@ class MailManager implements FactoryContract | ||||
|      * Create an instance of the Symfony Amazon SES Transport driver. | ||||
|      * | ||||
|      * @param  array  $config | ||||
|      * @return \Symfony\Component\Mailer\Bridge\Amazon\Transport\SesApiAsyncAwsTransport | ||||
|      * @return \Illuminate\Mail\Transport\SesTransport | ||||
|      */ | ||||
|     protected function createSesTransport(array $config) | ||||
|     { | ||||
| @@ -274,7 +275,7 @@ class MailManager implements FactoryContract | ||||
|      */ | ||||
|     protected function createMailgunTransport(array $config) | ||||
|     { | ||||
|         $factory = new MailgunTransportFactory(); | ||||
|         $factory = new MailgunTransportFactory(null, $this->getHttpClient($config)); | ||||
|  | ||||
|         if (! isset($config['secret'])) { | ||||
|             $config = $this->app['config']->get('services.mailgun', []); | ||||
| @@ -296,7 +297,7 @@ class MailManager implements FactoryContract | ||||
|      */ | ||||
|     protected function createPostmarkTransport(array $config) | ||||
|     { | ||||
|         $factory = new PostmarkTransportFactory(); | ||||
|         $factory = new PostmarkTransportFactory(null, $this->getHttpClient($config)); | ||||
|  | ||||
|         $options = isset($config['message_stream_id']) | ||||
|                     ? ['message_stream' => $config['message_stream_id']] | ||||
| @@ -369,6 +370,21 @@ class MailManager implements FactoryContract | ||||
|         return new ArrayTransport; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get a configured Symfony HTTP client instance. | ||||
|      * | ||||
|      * @return \Symfony\Contracts\HttpClient\HttpClientInterface|null | ||||
|      */ | ||||
|     protected function getHttpClient(array $config) | ||||
|     { | ||||
|         if ($options = ($config['client'] ?? false)) { | ||||
|             $maxHostConnections = Arr::pull($options, 'max_host_connections', 6); | ||||
|             $maxPendingPushes = Arr::pull($options, 'max_pending_pushes', 50); | ||||
|  | ||||
|             return HttpClient::create($options, $maxHostConnections, $maxPendingPushes); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Set a global address on the mailer by type. | ||||
|      * | ||||
|   | ||||
| @@ -1310,8 +1310,9 @@ class Mailable implements MailableContract, Renderable | ||||
|     { | ||||
|         [$html, $text] = $this->renderForAssertions(); | ||||
|  | ||||
|         PHPUnit::assertTrue( | ||||
|             str_contains($html, $string), | ||||
|         PHPUnit::assertStringContainsString( | ||||
|             $string, | ||||
|             $html, | ||||
|             "Did not see expected text [{$string}] within email body." | ||||
|         ); | ||||
|  | ||||
| @@ -1328,8 +1329,9 @@ class Mailable implements MailableContract, Renderable | ||||
|     { | ||||
|         [$html, $text] = $this->renderForAssertions(); | ||||
|  | ||||
|         PHPUnit::assertFalse( | ||||
|             str_contains($html, $string), | ||||
|         PHPUnit::assertStringNotContainsString( | ||||
|             $string, | ||||
|             $html, | ||||
|             "Saw unexpected text [{$string}] within email body." | ||||
|         ); | ||||
|  | ||||
| @@ -1361,8 +1363,9 @@ class Mailable implements MailableContract, Renderable | ||||
|     { | ||||
|         [$html, $text] = $this->renderForAssertions(); | ||||
|  | ||||
|         PHPUnit::assertTrue( | ||||
|             str_contains($text, $string), | ||||
|         PHPUnit::assertStringContainsString( | ||||
|             $string, | ||||
|             $text, | ||||
|             "Did not see expected text [{$string}] within text email body." | ||||
|         ); | ||||
|  | ||||
| @@ -1379,8 +1382,9 @@ class Mailable implements MailableContract, Renderable | ||||
|     { | ||||
|         [$html, $text] = $this->renderForAssertions(); | ||||
|  | ||||
|         PHPUnit::assertFalse( | ||||
|             str_contains($text, $string), | ||||
|         PHPUnit::assertStringNotContainsString( | ||||
|             $string, | ||||
|             $text, | ||||
|             "Saw unexpected text [{$string}] within text email body." | ||||
|         ); | ||||
|  | ||||
|   | ||||
| @@ -40,17 +40,21 @@ trait InteractsWithQueue | ||||
|     /** | ||||
|      * Fail the job from the queue. | ||||
|      * | ||||
|      * @param  \Throwable|null  $exception | ||||
|      * @param  \Throwable|string|null  $exception | ||||
|      * @return void | ||||
|      */ | ||||
|     public function fail($exception = null) | ||||
|     { | ||||
|         if (is_string($exception)) { | ||||
|             $exception = new ManuallyFailedException($exception); | ||||
|         } | ||||
|  | ||||
|         if ($exception instanceof Throwable || is_null($exception)) { | ||||
|             if ($this->job) { | ||||
|                 return $this->job->fail($exception); | ||||
|             } | ||||
|         } else { | ||||
|             throw new InvalidArgumentException('The fail method requires an instance of Throwable.'); | ||||
|             throw new InvalidArgumentException('The fail method requires a string or an instance of Throwable.'); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -123,8 +123,8 @@ abstract class AbstractRouteCollection implements Countable, IteratorAggregate, | ||||
|             $others, | ||||
|             sprintf( | ||||
|                 'The %s method is not supported for route %s. Supported methods: %s.', | ||||
|                 $request->path(), | ||||
|                 $method, | ||||
|                 $request->path(), | ||||
|                 implode(', ', $others) | ||||
|             ) | ||||
|         ); | ||||
|   | ||||
| @@ -100,6 +100,19 @@ class PendingSingletonResourceRegistration | ||||
|         return $this; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Indicate that the resource should have a deletion route. | ||||
|      * | ||||
|      * @param  bool  $destroyable | ||||
|      * @return $this | ||||
|      */ | ||||
|     public function destroyable($destroyable = true) | ||||
|     { | ||||
|         $this->options['destroyable'] = $destroyable; | ||||
|  | ||||
|         return $this; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Set the route names for controller actions. | ||||
|      * | ||||
|   | ||||
| @@ -259,6 +259,14 @@ class ResourceRegistrar | ||||
|             ); | ||||
|         } | ||||
|  | ||||
|         if (isset($options['destroyable'])) { | ||||
|             $methods = array_merge(['destroy'], $methods); | ||||
|  | ||||
|             return $this->getResourceMethods( | ||||
|                 $methods, array_values(Arr::except($options, ['destroyable'])) | ||||
|             ); | ||||
|         } | ||||
|  | ||||
|         return $methods; | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -119,7 +119,7 @@ class ResponseFactory implements FactoryContract | ||||
|     /** | ||||
|      * Create a new streamed response instance. | ||||
|      * | ||||
|      * @param  \Closure  $callback | ||||
|      * @param  callable  $callback | ||||
|      * @param  int  $status | ||||
|      * @param  array  $headers | ||||
|      * @return \Symfony\Component\HttpFoundation\StreamedResponse | ||||
| @@ -132,7 +132,7 @@ class ResponseFactory implements FactoryContract | ||||
|     /** | ||||
|      * Create a new streamed response instance as a file download. | ||||
|      * | ||||
|      * @param  \Closure  $callback | ||||
|      * @param  callable  $callback | ||||
|      * @param  string|null  $name | ||||
|      * @param  array  $headers | ||||
|      * @param  string|null  $disposition | ||||
|   | ||||
| @@ -39,7 +39,7 @@ class DatabaseSessionHandler implements ExistenceAwareInterface, SessionHandlerI | ||||
|     /** | ||||
|      * The container instance. | ||||
|      * | ||||
|      * @var \Illuminate\Contracts\Container\Container | ||||
|      * @var \Illuminate\Contracts\Container\Container|null | ||||
|      */ | ||||
|     protected $container; | ||||
|  | ||||
|   | ||||
| @@ -632,7 +632,7 @@ class Store implements Session | ||||
|     /** | ||||
|      * Set the session ID. | ||||
|      * | ||||
|      * @param  string  $id | ||||
|      * @param  string|null  $id | ||||
|      * @return void | ||||
|      */ | ||||
|     public function setId($id) | ||||
| @@ -643,7 +643,7 @@ class Store implements Session | ||||
|     /** | ||||
|      * Determine if this is a valid session ID. | ||||
|      * | ||||
|      * @param  string  $id | ||||
|      * @param  string|null  $id | ||||
|      * @return bool | ||||
|      */ | ||||
|     public function isValidId($id) | ||||
| @@ -739,7 +739,7 @@ class Store implements Session | ||||
|      * Set the underlying session handler implementation. | ||||
|      * | ||||
|      * @param  \SessionHandlerInterface  $handler | ||||
|      * @return void | ||||
|      * @return \SessionHandlerInterface | ||||
|      */ | ||||
|     public function setHandler(SessionHandlerInterface $handler) | ||||
|     { | ||||
|   | ||||
							
								
								
									
										10
									
								
								vendor/laravel/framework/src/Illuminate/Support/Exceptions/MathException.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								vendor/laravel/framework/src/Illuminate/Support/Exceptions/MathException.php
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,10 @@ | ||||
| <?php | ||||
|  | ||||
| namespace Illuminate\Support\Exceptions; | ||||
|  | ||||
| use RuntimeException; | ||||
|  | ||||
| class MathException extends RuntimeException | ||||
| { | ||||
|     // | ||||
| } | ||||
| @@ -104,7 +104,7 @@ namespace Illuminate\Support\Facades; | ||||
|  * @method static mixed rebinding(string $abstract, \Closure $callback) | ||||
|  * @method static mixed refresh(string $abstract, mixed $target, string $method) | ||||
|  * @method static \Closure wrap(\Closure $callback, array $parameters = []) | ||||
|  * @method static mixed call(callable|string $callback, array<string, mixed> $parameters = [], string|null $defaultMethod = null) | ||||
|  * @method static mixed call(callable|string $callback, array $parameters = [], string|null $defaultMethod = null) | ||||
|  * @method static \Closure factory(string $abstract) | ||||
|  * @method static mixed makeWith(string|callable $abstract, array $parameters = []) | ||||
|  * @method static mixed get(string $id) | ||||
|   | ||||
| @@ -14,10 +14,10 @@ namespace Illuminate\Support\Facades; | ||||
|  * @method static \Illuminate\Cache\CacheManager extend(string $driver, \Closure $callback) | ||||
|  * @method static bool has(array|string $key) | ||||
|  * @method static bool missing(string $key) | ||||
|  * @method static mixed get(array|string $key, mixed $default = null) | ||||
|  * @method static mixed get(array|string $key, mixed|\Closure $default = null) | ||||
|  * @method static array many(array $keys) | ||||
|  * @method static iterable getMultiple(iterable $keys, mixed $default = null) | ||||
|  * @method static mixed pull(string $key, mixed $default = null) | ||||
|  * @method static mixed pull(array|string $key, mixed|\Closure $default = null) | ||||
|  * @method static bool put(array|string $key, mixed $value, \DateTimeInterface|\DateInterval|int|null $ttl = null) | ||||
|  * @method static bool set(string $key, mixed $value, null|int|\DateInterval $ttl = null) | ||||
|  * @method static bool putMany(array $values, \DateTimeInterface|\DateInterval|int|null $ttl = null) | ||||
|   | ||||
| @@ -8,10 +8,10 @@ namespace Illuminate\Support\Facades; | ||||
|  * @method static \Symfony\Component\HttpFoundation\Cookie forget(string $name, string|null $path = null, string|null $domain = null) | ||||
|  * @method static bool hasQueued(string $key, string|null $path = null) | ||||
|  * @method static \Symfony\Component\HttpFoundation\Cookie|null queued(string $key, mixed $default = null, string|null $path = null) | ||||
|  * @method static void queue(array ...$parameters) | ||||
|  * @method static void queue(mixed ...$parameters) | ||||
|  * @method static void expire(string $name, string|null $path = null, string|null $domain = null) | ||||
|  * @method static void unqueue(string $name, string|null $path = null) | ||||
|  * @method static \Illuminate\Cookie\CookieJar setDefaultPathAndDomain(string $path, string $domain, bool $secure = false, string|null $sameSite = null) | ||||
|  * @method static \Illuminate\Cookie\CookieJar setDefaultPathAndDomain(string $path, string|null $domain, bool|null $secure = false, string|null $sameSite = null) | ||||
|  * @method static \Symfony\Component\HttpFoundation\Cookie[] getQueuedCookies() | ||||
|  * @method static \Illuminate\Cookie\CookieJar flushQueuedCookies() | ||||
|  * @method static void macro(string $name, object|callable $macro) | ||||
|   | ||||
| @@ -15,7 +15,7 @@ namespace Illuminate\Support\Facades; | ||||
|  * @method static string[] availableDrivers() | ||||
|  * @method static void extend(string $name, callable $resolver) | ||||
|  * @method static void forgetExtension(string $name) | ||||
|  * @method static array<string, \Illuminate\Database\Connection> getConnections() | ||||
|  * @method static array getConnections() | ||||
|  * @method static void setReconnector(callable $reconnector) | ||||
|  * @method static \Illuminate\Database\DatabaseManager setApplication(\Illuminate\Contracts\Foundation\Application $app) | ||||
|  * @method static void macro(string $name, object|callable $macro) | ||||
|   | ||||
| @@ -23,18 +23,18 @@ use Illuminate\Support\DateFactory; | ||||
|  * @method static \Illuminate\Support\Carbon createFromTimestampUTC($timestamp) | ||||
|  * @method static \Illuminate\Support\Carbon createMidnightDate($year = null, $month = null, $day = null, $tz = null) | ||||
|  * @method static \Illuminate\Support\Carbon|false createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null) | ||||
|  * @method static \Illuminate\Support\Carbon disableHumanDiffOption($humanDiffOption) | ||||
|  * @method static \Illuminate\Support\Carbon enableHumanDiffOption($humanDiffOption) | ||||
|  * @method static void disableHumanDiffOption($humanDiffOption) | ||||
|  * @method static void enableHumanDiffOption($humanDiffOption) | ||||
|  * @method static mixed executeWithLocale($locale, $func) | ||||
|  * @method static \Illuminate\Support\Carbon fromSerialized($value) | ||||
|  * @method static array getAvailableLocales() | ||||
|  * @method static array getDays() | ||||
|  * @method static int getHumanDiffOptions() | ||||
|  * @method static array getIsoUnits() | ||||
|  * @method static \Illuminate\Support\Carbon getLastErrors() | ||||
|  * @method static array getLastErrors() | ||||
|  * @method static string getLocale() | ||||
|  * @method static int getMidDayAt() | ||||
|  * @method static \Illuminate\Support\Carbon getTestNow() | ||||
|  * @method static \Illuminate\Support\Carbon|null getTestNow() | ||||
|  * @method static \Symfony\Component\Translation\TranslatorInterface getTranslator() | ||||
|  * @method static int getWeekEndsAt() | ||||
|  * @method static int getWeekStartsAt() | ||||
| @@ -46,7 +46,7 @@ use Illuminate\Support\DateFactory; | ||||
|  * @method static \Illuminate\Support\Carbon instance($date) | ||||
|  * @method static bool isImmutable() | ||||
|  * @method static bool isModifiableUnit($unit) | ||||
|  * @method static \Illuminate\Support\Carbon isMutable() | ||||
|  * @method static bool isMutable() | ||||
|  * @method static bool isStrictModeEnabled() | ||||
|  * @method static bool localeHasDiffOneDayWords($locale) | ||||
|  * @method static bool localeHasDiffSyntax($locale) | ||||
| @@ -65,13 +65,13 @@ use Illuminate\Support\DateFactory; | ||||
|  * @method static void resetToStringFormat() | ||||
|  * @method static void resetYearsOverflow() | ||||
|  * @method static void serializeUsing($callback) | ||||
|  * @method static \Illuminate\Support\Carbon setHumanDiffOptions($humanDiffOptions) | ||||
|  * @method static void setHumanDiffOptions($humanDiffOptions) | ||||
|  * @method static bool setLocale($locale) | ||||
|  * @method static void setMidDayAt($hour) | ||||
|  * @method static void setTestNow($testNow = null) | ||||
|  * @method static void setToStringFormat($format) | ||||
|  * @method static void setTranslator(\Symfony\Component\Translation\TranslatorInterface $translator) | ||||
|  * @method static \Illuminate\Support\Carbon setUtf8($utf8) | ||||
|  * @method static void setUtf8($utf8) | ||||
|  * @method static void setWeekEndsAt($day) | ||||
|  * @method static void setWeekStartsAt($day) | ||||
|  * @method static void setWeekendDays($days) | ||||
| @@ -81,7 +81,7 @@ use Illuminate\Support\DateFactory; | ||||
|  * @method static \Illuminate\Support\Carbon today($tz = null) | ||||
|  * @method static \Illuminate\Support\Carbon tomorrow($tz = null) | ||||
|  * @method static void useMonthsOverflow($monthsOverflow = true) | ||||
|  * @method static \Illuminate\Support\Carbon useStrictMode($strictModeEnabled = true) | ||||
|  * @method static void useStrictMode($strictModeEnabled = true) | ||||
|  * @method static void useYearsOverflow($yearsOverflow = true) | ||||
|  * @method static \Illuminate\Support\Carbon yesterday($tz = null) | ||||
|  * | ||||
|   | ||||
| @@ -48,8 +48,8 @@ namespace Illuminate\Support\Facades; | ||||
|  * @method static bool deleteDirectory(string $directory, bool $preserve = false) | ||||
|  * @method static bool deleteDirectories(string $directory) | ||||
|  * @method static bool cleanDirectory(string $directory) | ||||
|  * @method static \Illuminate\Filesystem\Filesystem|mixed when((\Closure(\Illuminate\Filesystem\Filesystem): mixed)|mixed $value = null, (callable(\Illuminate\Filesystem\Filesystem, mixed): mixed)|null $callback = null, (callable(\Illuminate\Filesystem\Filesystem, mixed): mixed)|null $default = null) | ||||
|  * @method static \Illuminate\Filesystem\Filesystem|mixed unless((\Closure(\Illuminate\Filesystem\Filesystem): mixed)|mixed $value = null, (callable(\Illuminate\Filesystem\Filesystem, mixed): mixed)|null $callback = null, (callable(\Illuminate\Filesystem\Filesystem, mixed): mixed)|null $default = null) | ||||
|  * @method static \Illuminate\Filesystem\Filesystem|mixed when(\Closure|mixed|null $value = null, callable|null $callback = null, callable|null $default = null) | ||||
|  * @method static \Illuminate\Filesystem\Filesystem|mixed unless(\Closure|mixed|null $value = null, callable|null $callback = null, callable|null $default = null) | ||||
|  * @method static void macro(string $name, object|callable $macro) | ||||
|  * @method static void mixin(object $mixin, bool $replace = true) | ||||
|  * @method static bool hasMacro(string $name) | ||||
|   | ||||
| @@ -28,8 +28,8 @@ use Illuminate\Contracts\Auth\Access\Gate as GateContract; | ||||
|  * @method static array abilities() | ||||
|  * @method static array policies() | ||||
|  * @method static \Illuminate\Auth\Access\Gate setContainer(\Illuminate\Contracts\Container\Container $container) | ||||
|  * @method static \Illuminate\Auth\Access\Response denyWithStatus(int $status, ?string $message = null, ?int $code = null) | ||||
|  * @method static \Illuminate\Auth\Access\Response denyAsNotFound(?string $message = null, ?int $code = null) | ||||
|  * @method static \Illuminate\Auth\Access\Response denyWithStatus(int $status, string|null $message = null, int|null $code = null) | ||||
|  * @method static \Illuminate\Auth\Access\Response denyAsNotFound(string|null $message = null, int|null $code = null) | ||||
|  * | ||||
|  * @see \Illuminate\Auth\Access\Gate | ||||
|  */ | ||||
|   | ||||
| @@ -76,8 +76,8 @@ use Illuminate\Http\Client\Factory; | ||||
|  * @method static \Illuminate\Http\Client\PendingRequest setClient(\GuzzleHttp\Client $client) | ||||
|  * @method static \Illuminate\Http\Client\PendingRequest setHandler(callable $handler) | ||||
|  * @method static array getOptions() | ||||
|  * @method static \Illuminate\Http\Client\PendingRequest|mixed when((\Closure(\Illuminate\Http\Client\PendingRequest): mixed)|mixed $value = null, (callable(\Illuminate\Http\Client\PendingRequest, mixed): mixed)|null $callback = null, (callable(\Illuminate\Http\Client\PendingRequest, mixed): mixed)|null $default = null) | ||||
|  * @method static \Illuminate\Http\Client\PendingRequest|mixed unless((\Closure(\Illuminate\Http\Client\PendingRequest): mixed)|mixed $value = null, (callable(\Illuminate\Http\Client\PendingRequest, mixed): mixed)|null $callback = null, (callable(\Illuminate\Http\Client\PendingRequest, mixed): mixed)|null $default = null) | ||||
|  * @method static \Illuminate\Http\Client\PendingRequest|mixed when(\Closure|mixed|null $value = null, callable|null $callback = null, callable|null $default = null) | ||||
|  * @method static \Illuminate\Http\Client\PendingRequest|mixed unless(\Closure|mixed|null $value = null, callable|null $callback = null, callable|null $default = null) | ||||
|  * | ||||
|  * @see \Illuminate\Http\Client\Factory | ||||
|  */ | ||||
|   | ||||
| @@ -158,7 +158,7 @@ namespace Illuminate\Support\Facades; | ||||
|  * @method static int integer(string $key, int $default = 0) | ||||
|  * @method static float float(string $key, float $default = 0) | ||||
|  * @method static \Illuminate\Support\Carbon|null date(string $key, string|null $format = null, string|null $tz = null) | ||||
|  * @method static object|null enum(string $key, class-string<object> $enumClass) | ||||
|  * @method static object|null enum(string $key, string $enumClass) | ||||
|  * @method static \Illuminate\Support\Collection collect(array|string|null $key = null) | ||||
|  * @method static array only(array|mixed $keys) | ||||
|  * @method static array except(array|mixed $keys) | ||||
|   | ||||
| @@ -10,8 +10,8 @@ use Illuminate\Contracts\Routing\ResponseFactory as ResponseFactoryContract; | ||||
|  * @method static \Illuminate\Http\Response view(string|array $view, array $data = [], int $status = 200, array $headers = []) | ||||
|  * @method static \Illuminate\Http\JsonResponse json(mixed $data = [], int $status = 200, array $headers = [], int $options = 0) | ||||
|  * @method static \Illuminate\Http\JsonResponse jsonp(string $callback, mixed $data = [], int $status = 200, array $headers = [], int $options = 0) | ||||
|  * @method static \Symfony\Component\HttpFoundation\StreamedResponse stream(\Closure $callback, int $status = 200, array $headers = []) | ||||
|  * @method static \Symfony\Component\HttpFoundation\StreamedResponse streamDownload(\Closure $callback, string|null $name = null, array $headers = [], string|null $disposition = 'attachment') | ||||
|  * @method static \Symfony\Component\HttpFoundation\StreamedResponse stream(callable $callback, int $status = 200, array $headers = []) | ||||
|  * @method static \Symfony\Component\HttpFoundation\StreamedResponse streamDownload(callable $callback, string|null $name = null, array $headers = [], string|null $disposition = 'attachment') | ||||
|  * @method static \Symfony\Component\HttpFoundation\BinaryFileResponse download(\SplFileInfo|string $file, string|null $name = null, array $headers = [], string|null $disposition = 'attachment') | ||||
|  * @method static \Symfony\Component\HttpFoundation\BinaryFileResponse file(\SplFileInfo|string $file, array $headers = []) | ||||
|  * @method static \Illuminate\Http\RedirectResponse redirectTo(string $path, int $status = 302, array $headers = [], bool|null $secure = null) | ||||
|   | ||||
| @@ -29,6 +29,7 @@ namespace Illuminate\Support\Facades; | ||||
|  * @method static void rename(string $from, string $to) | ||||
|  * @method static bool enableForeignKeyConstraints() | ||||
|  * @method static bool disableForeignKeyConstraints() | ||||
|  * @method static mixed withoutForeignKeyConstraints(\Closure $callback) | ||||
|  * @method static \Illuminate\Database\Connection getConnection() | ||||
|  * @method static \Illuminate\Database\Schema\Builder setConnection(\Illuminate\Database\Connection $connection) | ||||
|  * @method static void blueprintResolver(\Closure $resolver) | ||||
|   | ||||
| @@ -41,6 +41,42 @@ use Illuminate\Filesystem\Filesystem; | ||||
|  * @method static array allDirectories(string|null $directory = null) | ||||
|  * @method static bool makeDirectory(string $path) | ||||
|  * @method static bool deleteDirectory(string $directory) | ||||
|  * @method static \Illuminate\Filesystem\FilesystemAdapter assertExists(string|array $path, string|null $content = null) | ||||
|  * @method static \Illuminate\Filesystem\FilesystemAdapter assertMissing(string|array $path) | ||||
|  * @method static \Illuminate\Filesystem\FilesystemAdapter assertDirectoryEmpty(string $path) | ||||
|  * @method static bool missing(string $path) | ||||
|  * @method static bool fileExists(string $path) | ||||
|  * @method static bool fileMissing(string $path) | ||||
|  * @method static bool directoryExists(string $path) | ||||
|  * @method static bool directoryMissing(string $path) | ||||
|  * @method static string path(string $path) | ||||
|  * @method static \Symfony\Component\HttpFoundation\StreamedResponse response(string $path, string|null $name = null, array $headers = [], string|null $disposition = 'inline') | ||||
|  * @method static \Symfony\Component\HttpFoundation\StreamedResponse download(string $path, string|null $name = null, array $headers = []) | ||||
|  * @method static string|false putFile(string $path, \Illuminate\Http\File|\Illuminate\Http\UploadedFile|string $file, mixed $options = []) | ||||
|  * @method static string|false putFileAs(string $path, \Illuminate\Http\File|\Illuminate\Http\UploadedFile|string $file, string $name, mixed $options = []) | ||||
|  * @method static string|false checksum(string $path, array $options = []) | ||||
|  * @method static string|false mimeType(string $path) | ||||
|  * @method static string url(string $path) | ||||
|  * @method static bool providesTemporaryUrls() | ||||
|  * @method static string temporaryUrl(string $path, \DateTimeInterface $expiration, array $options = []) | ||||
|  * @method static \League\Flysystem\FilesystemOperator getDriver() | ||||
|  * @method static \League\Flysystem\FilesystemAdapter getAdapter() | ||||
|  * @method static array getConfig() | ||||
|  * @method static void buildTemporaryUrlsUsing(\Closure $callback) | ||||
|  * @method static \Illuminate\Filesystem\FilesystemAdapter|mixed when(\Closure|mixed|null $value = null, callable|null $callback = null, callable|null $default = null) | ||||
|  * @method static \Illuminate\Filesystem\FilesystemAdapter|mixed unless(\Closure|mixed|null $value = null, callable|null $callback = null, callable|null $default = null) | ||||
|  * @method static void macro(string $name, object|callable $macro) | ||||
|  * @method static void mixin(object $mixin, bool $replace = true) | ||||
|  * @method static bool hasMacro(string $name) | ||||
|  * @method static void flushMacros() | ||||
|  * @method static mixed macroCall(string $method, array $parameters) | ||||
|  * @method static bool has(string $location) | ||||
|  * @method static string read(string $location) | ||||
|  * @method static \League\Flysystem\DirectoryListing listContents(string $location, bool $deep = false) | ||||
|  * @method static int fileSize(string $path) | ||||
|  * @method static string visibility(string $path) | ||||
|  * @method static void write(string $location, string $contents, array $config = []) | ||||
|  * @method static void createDirectory(string $location, array $config = []) | ||||
|  * | ||||
|  * @see \Illuminate\Filesystem\FilesystemManager | ||||
|  */ | ||||
|   | ||||
| @@ -5,16 +5,16 @@ namespace Illuminate\Support\Facades; | ||||
| /** | ||||
|  * @method static array preloadedAssets() | ||||
|  * @method static string|null cspNonce() | ||||
|  * @method static string useCspNonce(?string $nonce = null) | ||||
|  * @method static string useCspNonce(string|null $nonce = null) | ||||
|  * @method static \Illuminate\Foundation\Vite useIntegrityKey(string|false $key) | ||||
|  * @method static \Illuminate\Foundation\Vite withEntryPoints(array $entryPoints) | ||||
|  * @method static \Illuminate\Foundation\Vite useManifestFilename(string $filename) | ||||
|  * @method static string hotFile() | ||||
|  * @method static \Illuminate\Foundation\Vite useHotFile(string $path) | ||||
|  * @method static \Illuminate\Foundation\Vite useBuildDirectory(string $path) | ||||
|  * @method static \Illuminate\Foundation\Vite useScriptTagAttributes((callable(string, string, ?array, ?array): array)|array $attributes) | ||||
|  * @method static \Illuminate\Foundation\Vite useStyleTagAttributes((callable(string, string, ?array, ?array): array)|array $attributes) | ||||
|  * @method static \Illuminate\Foundation\Vite usePreloadTagAttributes((callable(string, string, ?array, ?array): array|false)|array|false $attributes) | ||||
|  * @method static \Illuminate\Foundation\Vite useScriptTagAttributes(callable|array $attributes) | ||||
|  * @method static \Illuminate\Foundation\Vite useStyleTagAttributes(callable|array $attributes) | ||||
|  * @method static \Illuminate\Foundation\Vite usePreloadTagAttributes(callable|array|false $attributes) | ||||
|  * @method static \Illuminate\Support\HtmlString|void reactRefresh() | ||||
|  * @method static string asset(string $asset, string|null $buildDirectory = null) | ||||
|  * @method static string|null manifestHash(string|null $buildDirectory = null) | ||||
|   | ||||
| @@ -45,7 +45,8 @@ class Lottery | ||||
|      * Create a new Lottery instance. | ||||
|      * | ||||
|      * @param  int|float  $chances | ||||
|      * @param  ?int  $outOf | ||||
|      * @param  int|null  $outOf | ||||
|      * @return void | ||||
|      */ | ||||
|     public function __construct($chances, $outOf = null) | ||||
|     { | ||||
| @@ -62,7 +63,7 @@ class Lottery | ||||
|      * Create a new Lottery instance. | ||||
|      * | ||||
|      * @param  int|float  $chances | ||||
|      * @param  ?int  $outOf | ||||
|      * @param  int|null  $outOf | ||||
|      * @return static | ||||
|      */ | ||||
|     public static function odds($chances, $outOf = null) | ||||
|   | ||||
| @@ -79,7 +79,9 @@ class BatchFake extends Batch | ||||
|      */ | ||||
|     public function add($jobs) | ||||
|     { | ||||
|         $this->added[] = array_merge($this->added, $jobs); | ||||
|         foreach ($jobs as $job) { | ||||
|             $this->added[] = $job; | ||||
|         } | ||||
|  | ||||
|         return $this; | ||||
|     } | ||||
|   | ||||
| @@ -14,9 +14,11 @@ class Timebox | ||||
|     /** | ||||
|      * Invoke the given callback within the specified timebox minimum. | ||||
|      * | ||||
|      * @param  callable  $callback | ||||
|      * @template TCallReturnType | ||||
|      * | ||||
|      * @param  (callable($this): TCallReturnType)  $callback | ||||
|      * @param  int  $microseconds | ||||
|      * @return mixed | ||||
|      * @return TCallReturnType | ||||
|      */ | ||||
|     public function call(callable $callback, int $microseconds) | ||||
|     { | ||||
|   | ||||
| @@ -575,7 +575,7 @@ class TestResponse implements ArrayAccess | ||||
|     /** | ||||
|      * Assert that the given string matches the streamed response content. | ||||
|      * | ||||
|      * @param  $value | ||||
|      * @param  string  $value | ||||
|      * @return $this | ||||
|      */ | ||||
|     public function assertStreamedContent($value) | ||||
|   | ||||
| @@ -1681,7 +1681,7 @@ trait ValidatesAttributes | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Validate that an attribute does not exist. | ||||
|      * Validate that an attribute does not exist or is an empty string. | ||||
|      * | ||||
|      * @param  string  $attribute | ||||
|      * @param  mixed  $value | ||||
|   | ||||
| @@ -153,7 +153,7 @@ class InvokableValidationRule implements Rule, ValidatorAwareRule | ||||
|      * Create a pending potentially translated string. | ||||
|      * | ||||
|      * @param  string  $attribute | ||||
|      * @param  ?string  $message | ||||
|      * @param  string|null  $message | ||||
|      * @return \Illuminate\Translation\PotentiallyTranslatedString | ||||
|      */ | ||||
|     protected function pendingPotentiallyTranslatedString($attribute, $message) | ||||
|   | ||||
| @@ -86,9 +86,7 @@ class ValidationRuleParser | ||||
|     protected function explodeExplicitRule($rule, $attribute) | ||||
|     { | ||||
|         if (is_string($rule)) { | ||||
|             [$name] = static::parseStringRule($rule); | ||||
|  | ||||
|             return static::ruleIsRegex($name) ? [$rule] : explode('|', $rule); | ||||
|             return explode('|', $rule); | ||||
|         } | ||||
|  | ||||
|         if (is_object($rule)) { | ||||
|   | ||||
| @@ -274,7 +274,7 @@ class Validator implements ValidatorContract | ||||
|      * | ||||
|      * @var string[] | ||||
|      */ | ||||
|     protected $numericRules = ['Numeric', 'Integer']; | ||||
|     protected $numericRules = ['Numeric', 'Integer', 'Decimal']; | ||||
|  | ||||
|     /** | ||||
|      * The current placeholder for dots in rule keys. | ||||
|   | ||||
| @@ -16,7 +16,7 @@ | ||||
|     "require": { | ||||
|         "php": "^8.0.2", | ||||
|         "ext-json": "*", | ||||
|         "egulias/email-validator": "^3.2.1", | ||||
|         "egulias/email-validator": "^3.2.1|^4.0", | ||||
|         "illuminate/collections": "^9.0", | ||||
|         "illuminate/container": "^9.0", | ||||
|         "illuminate/contracts": "^9.0", | ||||
|   | ||||
| @@ -499,16 +499,67 @@ class BladeCompiler extends Compiler implements CompilerInterface | ||||
|     /** | ||||
|      * Compile Blade statements that start with "@". | ||||
|      * | ||||
|      * @param  string  $value | ||||
|      * @param  string  $template | ||||
|      * @return string | ||||
|      */ | ||||
|     protected function compileStatements($value) | ||||
|     protected function compileStatements($template) | ||||
|     { | ||||
|         return preg_replace_callback( | ||||
|             '/\B@(@?\w+(?:::\w+)?)([ \t]*)(\( ( (?>[^()]+) | (?3) )* \))?/x', function ($match) { | ||||
|                 return $this->compileStatement($match); | ||||
|             }, $value | ||||
|         ); | ||||
|         preg_match_all('/\B@(@?\w+(?:::\w+)?)([ \t]*)(\( ( [\S\s]*? ) \))?/x', $template, $matches); | ||||
|  | ||||
|         for ($i = 0; isset($matches[0][$i]); $i++) { | ||||
|             $match = [ | ||||
|                 $matches[0][$i], | ||||
|                 $matches[1][$i], | ||||
|                 $matches[2][$i], | ||||
|                 $matches[3][$i] ?: null, | ||||
|                 $matches[4][$i] ?: null, | ||||
|             ]; | ||||
|  | ||||
|             // Here we check to see if we have properly found the closing parenthesis by | ||||
|             // regex pattern or not, and will recursively continue on to the next ")" | ||||
|             // then check again until the tokenizer confirms we find the right one. | ||||
|             while (isset($match[4]) && | ||||
|                    Str::endsWith($match[0], ')') && | ||||
|                    ! $this->hasEvenNumberOfParentheses($match[0])) { | ||||
|                 $rest = Str::before(Str::after($template, $match[0]), ')'); | ||||
|  | ||||
|                 $match[0] = $match[0].$rest.')'; | ||||
|                 $match[3] = $match[3].$rest.')'; | ||||
|                 $match[4] = $match[4].$rest; | ||||
|             } | ||||
|  | ||||
|             $template = Str::replaceFirst($match[0], $this->compileStatement($match), $template); | ||||
|         } | ||||
|  | ||||
|         return $template; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Determine if the given expression has the same number of opening and closing parentheses. | ||||
|      * | ||||
|      * @param  string  $expression | ||||
|      * @return bool | ||||
|      */ | ||||
|     protected function hasEvenNumberOfParentheses(string $expression) | ||||
|     { | ||||
|         $tokens = token_get_all('<?php '.$expression); | ||||
|  | ||||
|         if (Arr::last($tokens) !== ')') { | ||||
|             return false; | ||||
|         } | ||||
|  | ||||
|         $opening = 0; | ||||
|         $closing = 0; | ||||
|  | ||||
|         foreach ($tokens as $token) { | ||||
|             if ($token == ')') { | ||||
|                 $closing++; | ||||
|             } elseif ($token == '(') { | ||||
|                 $opening++; | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         return $opening === $closing; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -52,7 +52,7 @@ trait CompilesHelpers | ||||
|     /** | ||||
|      * Compile the "vite" statements into valid PHP. | ||||
|      * | ||||
|      * @param  ?string  $arguments | ||||
|      * @param  string|null  $arguments | ||||
|      * @return string | ||||
|      */ | ||||
|     protected function compileVite($arguments) | ||||
|   | ||||
| @@ -90,6 +90,49 @@ class View implements ArrayAccess, Htmlable, ViewContract | ||||
|         }); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get the evaluated contents for a given array of fragments. | ||||
|      * | ||||
|      * @param  array  $fragments | ||||
|      * @return string | ||||
|      */ | ||||
|     public function fragments(array $fragments) | ||||
|     { | ||||
|         return collect($fragments)->map(fn ($f) => $this->fragment($f))->implode(''); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get the evaluated contents of a given fragment if the given condition is true. | ||||
|      * | ||||
|      * @param  bool  $boolean | ||||
|      * @param  string  $fragment | ||||
|      * @return string | ||||
|      */ | ||||
|     public function fragmentIf($boolean, $fragment) | ||||
|     { | ||||
|         if (value($boolean)) { | ||||
|             return $this->fragment($fragment); | ||||
|         } | ||||
|  | ||||
|         return $this->render(); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get the evaluated contents for a given array of fragments if the given condition is true. | ||||
|      * | ||||
|      * @param  bool  $boolean | ||||
|      * @param  array  $fragments | ||||
|      * @return string | ||||
|      */ | ||||
|     public function fragmentsIf($boolean, array $fragments) | ||||
|     { | ||||
|         if (value($boolean)) { | ||||
|             return $this->fragments($fragments); | ||||
|         } | ||||
|  | ||||
|         return $this->render(); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get the string contents of the view. | ||||
|      * | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 RafficMohammed
					RafficMohammed