🔧 Update npm + login page

This commit is contained in:
TiclemFR
2024-01-25 14:00:48 +01:00
parent 468c2cd0e6
commit 336f2bae93
128 changed files with 3078 additions and 2368 deletions

View File

@@ -1,6 +1,31 @@
# Release Notes for 10.x
## [Unreleased](https://github.com/laravel/framework/compare/v10.40.0...10.x)
## [Unreleased](https://github.com/laravel/framework/compare/v10.41.0...10.x)
## [v10.41.0](https://github.com/laravel/framework/compare/v10.40.0...v10.41.0) - 2024-01-16
* [10.x] Add a `threshold` parameter to the `Number::spell` helper by [@caendesilva](https://github.com/caendesilva) in https://github.com/laravel/framework/pull/49610
* Revert "[10.x] Make ComponentAttributeBag Arrayable" by [@luanfreitasdev](https://github.com/luanfreitasdev) in https://github.com/laravel/framework/pull/49623
* [10.x] Fix return value and docblock by [@dwightwatson](https://github.com/dwightwatson) in https://github.com/laravel/framework/pull/49627
* [10.x] Add an option to specify the default path to the models directory for `php artisan model:prune` by [@dbhynds](https://github.com/dbhynds) in https://github.com/laravel/framework/pull/49617
* [10.x] Allow job chains to be conditionally dispatched by [@fjarrett](https://github.com/fjarrett) in https://github.com/laravel/framework/pull/49624
* [10.x] Add test for existing empty test by [@lioneaglesolutions](https://github.com/lioneaglesolutions) in https://github.com/laravel/framework/pull/49632
* [10.x] Add additional context to Mailable assertion messages by [@lioneaglesolutions](https://github.com/lioneaglesolutions) in https://github.com/laravel/framework/pull/49631
* [10.x] Allow job batches to be conditionally dispatched by [@fjarrett](https://github.com/fjarrett) in https://github.com/laravel/framework/pull/49639
* [10.x] Revert parameter name change by [@timacdonald](https://github.com/timacdonald) in https://github.com/laravel/framework/pull/49659
* [10.x] Printing Name of The Method that Calls `ensureIntlExtensionIsInstalled` in `Number` class. by [@devajmeireles](https://github.com/devajmeireles) in https://github.com/laravel/framework/pull/49660
* [10.x] Update pagination tailwind.blade.php by [@anasmorahhib](https://github.com/anasmorahhib) in https://github.com/laravel/framework/pull/49665
* [10.x] feat: add base argument to Stringable->toInteger() by [@adamczykpiotr](https://github.com/adamczykpiotr) in https://github.com/laravel/framework/pull/49670
* [10.x]: Remove unused class ShouldBeUnique when make a job by [@Kenini1805](https://github.com/Kenini1805) in https://github.com/laravel/framework/pull/49669
* [10.x] Add tests for Eloquent methods by [@milwad-dev](https://github.com/milwad-dev) in https://github.com/laravel/framework/pull/49673
* Implement draft workflow by [@driesvints](https://github.com/driesvints) in https://github.com/laravel/framework/pull/49683
* [10.x] Fixing Types, Word and Returns of `Number`class. by [@devajmeireles](https://github.com/devajmeireles) in https://github.com/laravel/framework/pull/49681
* [10.x] Test Improvements by [@crynobone](https://github.com/crynobone) in https://github.com/laravel/framework/pull/49679
* [10.x] Officially support floats in trans_choice and Translator::choice by [@philbates35](https://github.com/philbates35) in https://github.com/laravel/framework/pull/49693
* [10.x] Use static function by [@michaelnabil230](https://github.com/michaelnabil230) in https://github.com/laravel/framework/pull/49696
* [10.x] Revert "[10.x] Improve numeric comparison for custom casts" by [@driesvints](https://github.com/driesvints) in https://github.com/laravel/framework/pull/49702
* [10.x] Add exit code to queue:clear, and queue:forget commands by [@bytestream](https://github.com/bytestream) in https://github.com/laravel/framework/pull/49707
* [10.x] Allow StreamInterface as raw HTTP Client body by [@janolivermr](https://github.com/janolivermr) in https://github.com/laravel/framework/pull/49705
## [v10.40.0](https://github.com/laravel/framework/compare/v10.39.0...v10.40.0) - 2024-01-09

View File

@@ -1740,6 +1740,8 @@ class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable
*/
protected function now()
{
return Carbon::now()->timestamp;
return class_exists(Carbon::class)
? Carbon::now()->timestamp
: time();
}
}

View File

@@ -546,7 +546,7 @@ class Filesystem
{
$hash = @md5_file($firstFile);
return $hash && $hash === @md5_file($secondFile);
return $hash && hash_equals($hash, (string) @md5_file($secondFile));
}
/**

View File

@@ -40,7 +40,7 @@ class Application extends Container implements ApplicationContract, CachesConfig
*
* @var string
*/
const VERSION = '10.41.0';
const VERSION = '10.42.0';
/**
* The base path for the Laravel installation.

View File

@@ -36,6 +36,13 @@ class Factory
*/
protected $globalMiddleware = [];
/**
* The options to apply to every request.
*
* @var array
*/
protected $globalOptions = [];
/**
* The stub callables that will handle requests.
*
@@ -123,6 +130,19 @@ class Factory
return $this;
}
/**
* Set the options to apply to every request.
*
* @param array $options
* @return $this
*/
public function globalOptions($options)
{
$this->globalOptions = $options;
return $this;
}
/**
* Create a new response instance for use during stubbing.
*
@@ -400,7 +420,7 @@ class Factory
*/
protected function newPendingRequest()
{
return new PendingRequest($this, $this->globalMiddleware);
return (new PendingRequest($this, $this->globalMiddleware))->withOptions($this->globalOptions);
}
/**

View File

@@ -2,6 +2,7 @@
namespace Illuminate\Mail\Transport;
use Illuminate\Support\Str;
use Psr\Log\LoggerInterface;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component\Mailer\SentMessage;
@@ -33,17 +34,48 @@ class LogTransport implements TransportInterface
*/
public function send(RawMessage $message, Envelope $envelope = null): ?SentMessage
{
$string = $message->toString();
$string = Str::of($message->toString());
if (str_contains($string, 'Content-Transfer-Encoding: quoted-printable')) {
$string = quoted_printable_decode($string);
if ($string->contains('Content-Type: multipart/')) {
$boundary = $string
->after('boundary=')
->before("\r\n")
->prepend('--')
->append("\r\n");
$string = $string
->explode($boundary)
->map($this->decodeQuotedPrintableContent(...))
->implode($boundary);
} elseif ($string->contains('Content-Transfer-Encoding: quoted-printable')) {
$string = $this->decodeQuotedPrintableContent($string);
}
$this->logger->debug($string);
$this->logger->debug((string) $string);
return new SentMessage($message, $envelope ?? Envelope::create($message));
}
/**
* Decode the given quoted printable content.
*
* @param string $part
* @return string
*/
protected function decodeQuotedPrintableContent(string $part)
{
if (! str_contains($part, 'Content-Transfer-Encoding: quoted-printable')) {
return $part;
}
[$headers, $content] = explode("\r\n\r\n", $part, 2);
return implode("\r\n\r\n", [
$headers,
quoted_printable_decode($content),
]);
}
/**
* Get the logger for the LogTransport instance.
*

View File

@@ -0,0 +1,58 @@
<?php
namespace Illuminate\Queue\Events;
use RuntimeException;
class JobQueueing
{
/**
* The connection name.
*
* @var string
*/
public $connectionName;
/**
* The job instance.
*
* @var \Closure|string|object
*/
public $job;
/**
* The job payload.
*
* @var string|null
*/
public $payload;
/**
* Create a new event instance.
*
* @param string $connectionName
* @param \Closure|string|object $job
* @param string|null $payload
* @return void
*/
public function __construct($connectionName, $job, $payload = null)
{
$this->connectionName = $connectionName;
$this->job = $job;
$this->payload = $payload;
}
/**
* Get the decoded job payload.
*
* @return array
*/
public function payload()
{
if ($this->payload === null) {
throw new RuntimeException('The job payload was not provided when the event was dispatched.');
}
return json_decode($this->payload, true, flags: JSON_THROW_ON_ERROR);
}
}

View File

@@ -9,6 +9,7 @@ use Illuminate\Contracts\Encryption\Encrypter;
use Illuminate\Contracts\Queue\ShouldBeEncrypted;
use Illuminate\Contracts\Queue\ShouldQueueAfterCommit;
use Illuminate\Queue\Events\JobQueued;
use Illuminate\Queue\Events\JobQueueing;
use Illuminate\Support\Arr;
use Illuminate\Support\InteractsWithTime;
use Illuminate\Support\Str;
@@ -327,6 +328,8 @@ abstract class Queue
$this->container->bound('db.transactions')) {
return $this->container->make('db.transactions')->addCallback(
function () use ($payload, $queue, $delay, $callback, $job) {
$this->raiseJobQueueingEvent($job, $payload);
return tap($callback($payload, $queue, $delay), function ($jobId) use ($job, $payload) {
$this->raiseJobQueuedEvent($jobId, $job, $payload);
});
@@ -334,6 +337,8 @@ abstract class Queue
);
}
$this->raiseJobQueueingEvent($job, $payload);
return tap($callback($payload, $queue, $delay), function ($jobId) use ($job, $payload) {
$this->raiseJobQueuedEvent($jobId, $job, $payload);
});
@@ -362,6 +367,20 @@ abstract class Queue
return false;
}
/**
* Raise the job queueing event.
*
* @param \Closure|string|object $job
* @param string $payload
* @return void
*/
protected function raiseJobQueueingEvent($job, $payload)
{
if ($this->container->bound('events')) {
$this->container['events']->dispatch(new JobQueueing($this->connectionName, $job, $payload));
}
}
/**
* Raise the job queued event.
*

View File

@@ -29,9 +29,11 @@ class Carbon extends BaseCarbon
*/
public static function createFromId($id)
{
return Ulid::isValid($id)
? static::createFromInterface(Ulid::fromString($id)->getDateTime())
: static::createFromInterface(Uuid::fromString($id)->getDateTime());
if (is_string($id)) {
$id = Ulid::isValid($id) ? Ulid::fromString($id) : Uuid::fromString($id);
}
return static::createFromInterface($id->getDateTime());
}
/**

View File

@@ -33,10 +33,10 @@ class DefaultProviders
\Illuminate\Mail\MailServiceProvider::class,
\Illuminate\Notifications\NotificationServiceProvider::class,
\Illuminate\Pagination\PaginationServiceProvider::class,
\Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
\Illuminate\Pipeline\PipelineServiceProvider::class,
\Illuminate\Queue\QueueServiceProvider::class,
\Illuminate\Redis\RedisServiceProvider::class,
\Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
\Illuminate\Session\SessionServiceProvider::class,
\Illuminate\Translation\TranslationServiceProvider::class,
\Illuminate\Validation\ValidationServiceProvider::class,

View File

@@ -8,6 +8,7 @@ use Illuminate\Http\Client\Factory;
* @method static \Illuminate\Http\Client\Factory globalMiddleware(callable $middleware)
* @method static \Illuminate\Http\Client\Factory globalRequestMiddleware(callable $middleware)
* @method static \Illuminate\Http\Client\Factory globalResponseMiddleware(callable $middleware)
* @method static \Illuminate\Http\Client\Factory globalOptions(array $options)
* @method static \GuzzleHttp\Promise\PromiseInterface response(array|string|null $body = null, int $status = 200, array $headers = [])
* @method static \Illuminate\Http\Client\ResponseSequence sequence(array $responses = [])
* @method static \Illuminate\Http\Client\Factory allowStrayRequests()

View File

@@ -54,6 +54,23 @@ class Notification extends Facade
});
}
/**
* Begin sending a notification to an anonymous notifiable on the given channels.
*
* @param array $channels
* @return \Illuminate\Notifications\AnonymousNotifiable
*/
public static function routes(array $channels)
{
$notifiable = new AnonymousNotifiable;
foreach ($channels as $channel => $route) {
$notifiable->route($channel, $route);
}
return $notifiable;
}
/**
* Begin sending a notification to an anonymous notifiable.
*

View File

@@ -390,6 +390,27 @@ class Str
return $before.$value.($after ??= $before);
}
/**
* Unwrap the string with the given strings.
*
* @param string $value
* @param string $before
* @param string|null $after
* @return string
*/
public static function unwrap($value, $before, $after = null)
{
if (static::startsWith($value, $before)) {
$value = static::substr($value, static::length($before));
}
if (static::endsWith($value, $after ??= $before)) {
$value = static::substr($value, 0, -static::length($after));
}
return $value;
}
/**
* Determine if a given string matches a given pattern.
*

View File

@@ -1224,6 +1224,18 @@ class Stringable implements JsonSerializable, ArrayAccess
return new static(Str::wrap($this->value, $before, $after));
}
/**
* Unwrap the string with the given strings.
*
* @param string $before
* @param string|null $after
* @return static
*/
public function unwrap($before, $after = null)
{
return new static(Str::unwrap($this->value, $before, $after));
}
/**
* Convert the string into a `HtmlString` instance.
*

View File

@@ -56,7 +56,7 @@ class Rule
*/
public static function unless($condition, $rules, $defaultRules = [])
{
return new ConditionalRules(! $condition, $rules, $defaultRules);
return new ConditionalRules($condition, $defaultRules, $rules);
}
/**

View File

@@ -37,6 +37,13 @@ class Password implements Rule, DataAwareRule, ValidatorAwareRule
*/
protected $min = 8;
/**
* The maximum size of the password.
*
* @var int
*/
protected $max;
/**
* If the password requires at least one uppercase and one lowercase letter.
*
@@ -193,7 +200,7 @@ class Password implements Rule, DataAwareRule, ValidatorAwareRule
}
/**
* Sets the minimum size of the password.
* Set the minimum size of the password.
*
* @param int $size
* @return $this
@@ -203,6 +210,19 @@ class Password implements Rule, DataAwareRule, ValidatorAwareRule
return new static($size);
}
/**
* Set the maximum size of the password.
*
* @param int $size
* @return $this
*/
public function max($size)
{
$this->max = $size;
return $this;
}
/**
* Ensures the password has not been compromised in data leaks.
*
@@ -300,6 +320,10 @@ class Password implements Rule, DataAwareRule, ValidatorAwareRule
return;
}
if ($this->max && mb_strlen($value) > $this->max) {
$validator->addFailure($attribute, 'max.string');
}
if ($this->mixedCase && ! preg_match('/(\p{Ll}+.*\p{Lu})|(\p{Lu}+.*\p{Ll})/u', $value)) {
$validator->addFailure($attribute, 'password.mixed');
}

Binary file not shown.

View File

@@ -23,8 +23,8 @@
"ext-xml": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.47.0",
"illuminate/view": "^10.40.0",
"friendsofphp/php-cs-fixer": "^3.47.1",
"illuminate/view": "^10.41.0",
"larastan/larastan": "^2.8.1",
"laravel-zero/framework": "^10.3.0",
"mockery/mockery": "^1.6.7",