Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
add16f0
Complete email verification and having-range documentation
binaryfire Sep 9, 2026
a7272db
Complete encryption and collection porting conventions
binaryfire Sep 9, 2026
fae6b75
Complete binary-cast annotations and filesystem fake test parity
binaryfire Sep 9, 2026
7dab54e
Accept closure subqueries across between query methods
binaryfire Sep 9, 2026
59140c2
Complete appended validation rules and resource test parity
binaryfire Sep 9, 2026
c5adaab
Complete array filtering and cloned connection test parity
binaryfire Sep 9, 2026
d6c3f41
Complete migration and schema typing from Laravel
binaryfire Sep 9, 2026
532f39b
Preserve blueprint resolvers across schema facade calls
binaryfire Sep 10, 2026
40c3e2a
Complete queue routing regression coverage
binaryfire Sep 10, 2026
b0efb07
Reject unknown PDO sessions without configurators
binaryfire Sep 10, 2026
acbc23b
Recover database queue reservation failures without losing valid jobs
binaryfire Sep 10, 2026
54864ae
Port queue forwarding and preserve queue identity across storage oper…
binaryfire Sep 10, 2026
c9d67e7
Merge 0.4 into Laravel parity branch
binaryfire Sep 10, 2026
da0037d
Preserve valid database jobs when query observers fail
binaryfire Sep 10, 2026
ffc2c40
Clarify caller-selected queues in forwarding resolvers
binaryfire Sep 10, 2026
ae141dc
Port missing generator command integration coverage
binaryfire Sep 10, 2026
e5ad984
Resolve schema connections from the owning container
binaryfire Sep 10, 2026
1b817e4
Clarify connection selection when clearing forwarded queues
binaryfire Sep 10, 2026
bd285fb
Explain the logical queue assertion in forwarded mail coverage
binaryfire Sep 10, 2026
ce5f3cf
Use native configuration for standalone Capsules
binaryfire Sep 10, 2026
667a9ef
Share queue connector registration with standalone Capsule
binaryfire Sep 10, 2026
d4abf1b
Resolve queue routes through their owning container
binaryfire Sep 10, 2026
25a74f0
Regenerate queue routing facade annotations
binaryfire Sep 10, 2026
5d0406c
Preserve queued jobs when observer queries fail
binaryfire Sep 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/broadcasting/src/BroadcastManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,7 @@ public function queue(mixed $event): void

if (is_null($queue)) {
$queue = $this->getAttributeValue($event, QueueAttribute::class, 'queue')
?? $this->resolveQueueFromQueueRoute($event)
?? null;
?? $this->resolveQueueFromQueueRoute($event);
}

$broadcastEvent = $event instanceof ShouldBeUnique
Expand All @@ -233,8 +232,7 @@ public function queue(mixed $event): void
->connection(
$event->connection
?? $this->getAttributeValue($event, ConnectionAttribute::class, 'connection')
?? $this->resolveConnectionFromQueueRoute($event)
?? null
?? $this->resolveConnectionFromQueueRoute($event, $queue)
)
->pushOn($queue, $broadcastEvent);

Expand All @@ -254,6 +252,14 @@ public function queue(mixed $event): void
: $push();
}

/**
* Get the container that owns the queue routes.
*/
protected function queueRoutesContainer(): Container
{
return $this->app;
}

/**
* Determine if the broadcastable event must be unique and determine if we can acquire the necessary lock.
*/
Expand Down
8 changes: 8 additions & 0 deletions src/bus/src/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,14 @@ public function dispatchAfterResponse(mixed $command, mixed $handler = null): vo
}
}

/**
* Get the container that owns the queue routes.
*/
protected function queueRoutesContainer(): Container
{
return $this->container;
}

/**
* Set the pipes through which commands should be piped before dispatching.
*
Expand Down
2 changes: 2 additions & 0 deletions src/collections/src/LazyCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,8 @@ public function slice(int $offset, ?int $length = null): static
}

/**
* Split a collection into a certain number of groups.
*
* @throws InvalidArgumentException
*/
#[Override]
Expand Down
2 changes: 1 addition & 1 deletion src/console/src/Concerns/InteractsWithIO.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ trait InteractsWithIO
protected int $verbosity = OutputInterface::VERBOSITY_NORMAL;

/**
* The mapping between human readable verbosity levels and Symfony's OutputInterface.
* The mapping between human-readable verbosity levels and Symfony's OutputInterface.
*/
protected array $verbosityMap = [
'v' => OutputInterface::VERBOSITY_VERBOSE,
Expand Down
2 changes: 1 addition & 1 deletion src/console/src/Scheduling/ManagesAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ trait ManagesAttributes
protected array $rejects = [];

/**
* The human readable description of the event.
* The human-readable description of the event.
*/
public ?string $description = null;

Expand Down
2 changes: 1 addition & 1 deletion src/database/src/Concerns/ManagesTransactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ protected function handleTransactionException(Throwable $e, int $currentAttempt,

$exception = new DeadlockException(
$e->getMessage(),
is_int($e->getCode()) ? $e->getCode() : 0,
$e->getCode(),
$e
);

Expand Down
4 changes: 2 additions & 2 deletions src/database/src/DatabaseServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ protected function registerConnectionServices(): void
return $app->make('db')->connection();
});

$this->app->singleton('db.schema', function () {
return new SchemaProxy;
$this->app->singleton('db.schema', function ($app) {
return new SchemaProxy($app);
});

$this->app->singleton('db.transactions', function () {
Expand Down
15 changes: 15 additions & 0 deletions src/database/src/DeadlockException.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,22 @@
namespace Hypervel\Database;

use PDOException;
use Throwable;

class DeadlockException extends PDOException
{
/**
* Create a new deadlock exception instance.
*/
public function __construct(string $message = '', int|string $code = 0, ?Throwable $previous = null)
{
parent::__construct($message, 0, $previous);

// Losing driver metadata makes nested concurrency failures unrecognizable to error detectors.
$this->code = $code;

if ($previous instanceof PDOException) {
$this->errorInfo = $previous->errorInfo;
}
}
}
11 changes: 11 additions & 0 deletions src/database/src/Eloquent/Casts/AsBinary.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,17 @@ class AsBinary implements Castable
* Get the caster class to use when casting from / to this cast target.
*
* @param array{string} $arguments
*
* @throws InvalidArgumentException
*/
public static function castUsing(array $arguments): CastsAttributes
{
return new class($arguments) implements CastsAttributes {
protected string $format;

/**
* Create a new binary cast instance.
*/
public function __construct(protected array $arguments)
{
$this->format = $this->arguments[0]
Expand All @@ -35,6 +40,9 @@ public function __construct(protected array $arguments)
}
}

/**
* Transform the attribute from the underlying model values.
*/
public function get(mixed $model, string $key, mixed $value, array $attributes): ?string
{
$attribute = $attributes[$key] ?? null;
Expand All @@ -50,6 +58,9 @@ public function get(mixed $model, string $key, mixed $value, array $attributes):
return BinaryCodec::decode($attribute, $this->format);
}

/**
* Transform the attribute to its underlying model values.
*/
public function set(mixed $model, string $key, mixed $value, array $attributes): array
{
return [$key => BinaryCodec::encode($value, $this->format)];
Expand Down
12 changes: 12 additions & 0 deletions src/database/src/Migrations/DatabaseMigrationRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public function __construct(

/**
* Get the completed migrations.
*
* @return string[]
*/
public function getRan(): array
{
Expand All @@ -37,6 +39,8 @@ public function getRan(): array

/**
* Get the list of migrations.
*
* @return object{id: int, migration: string, batch: int}[]
*/
public function getMigrations(int $steps): array
{
Expand All @@ -51,6 +55,8 @@ public function getMigrations(int $steps): array

/**
* Get the list of the migrations by batch number.
*
* @return object{id: int, migration: string, batch: int}[]
*/
public function getMigrationsByBatch(int $batch): array
{
Expand All @@ -63,6 +69,8 @@ public function getMigrationsByBatch(int $batch): array

/**
* Get the last migration batch.
*
* @return object{id: int, migration: string, batch: int}[]
*/
public function getLast(): array
{
Expand All @@ -73,6 +81,8 @@ public function getLast(): array

/**
* Get the completed migrations with their batch numbers.
*
* @return array<string, int>
*/
public function getMigrationBatches(): array
{
Expand All @@ -94,6 +104,8 @@ public function log(string $file, int $batch): void

/**
* Remove a migration from the log.
*
* @param object{id?: int, migration: string, batch?: int} $migration
*/
public function delete(object $migration): void
{
Expand Down
7 changes: 7 additions & 0 deletions src/database/src/Migrations/MigrationCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class MigrationCreator

/**
* The registered post create hooks.
*
* @var (Closure(?string, string): void)[]
*/
protected array $postCreate = [];

Expand Down Expand Up @@ -169,6 +171,11 @@ protected function firePostCreateHooks(?string $table, string $path): void

/**
* Register a post migration create hook.
*
* Boot-only. Hooks persist on the migration creator for the worker
* lifetime and run for every subsequent migration creation.
*
* @param Closure(?string, string): void $callback
*/
public function afterCreate(Closure $callback): void
{
Expand Down
12 changes: 12 additions & 0 deletions src/database/src/Migrations/MigrationRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,36 @@ interface MigrationRepositoryInterface
{
/**
* Get the completed migrations.
*
* @return string[]
*/
public function getRan(): array;

/**
* Get the list of migrations.
*
* @return object{id: int, migration: string, batch: int}[]
*/
public function getMigrations(int $steps): array;

/**
* Get the list of the migrations by batch.
*
* @return object{id: int, migration: string, batch: int}[]
*/
public function getMigrationsByBatch(int $batch): array;

/**
* Get the last migration batch.
*
* @return object{id: int, migration: string, batch: int}[]
*/
public function getLast(): array;

/**
* Get the completed migrations with their batch numbers.
*
* @return array<string, int>
*/
public function getMigrationBatches(): array;

Expand All @@ -38,6 +48,8 @@ public function log(string $file, int $batch): void;

/**
* Remove a migration from the log.
*
* @param object{id?: int, migration: string, batch?: int} $migration
*/
public function delete(object $migration): void;

Expand Down
5 changes: 5 additions & 0 deletions src/database/src/Migrations/Migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class Migrator
{
/**
* The custom connection resolver callback.
*
* @var null|(Closure(Resolver, ?string): Connection)
*/
protected static ?Closure $connectionResolverCallback = null;

Expand Down Expand Up @@ -263,6 +265,7 @@ public function rollback(array|string $paths = [], array $options = []): array
* Get the migrations for a rollback operation.
*
* @param array<string, mixed> $options
* @return object{id: int, migration: string, batch: int}[]
*/
protected function getMigrationsForRollback(array $options): array
{
Expand Down Expand Up @@ -799,6 +802,8 @@ public function resolveConnection(?string $connection): Connection
*
* Boot-only. The callback persists in a static property for the worker
* lifetime and runs on every migration's connection resolution.
*
* @param Closure(Resolver, ?string): Connection $callback
*/
public static function resolveConnectionsUsing(Closure $callback): void
{
Expand Down
5 changes: 3 additions & 2 deletions src/database/src/PdoConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,8 @@ public function getPdo(): PDO
$this->latestReadWriteTypeRetrieved = 'write';
$pdo = $this->resolvePdo();

return static::$sessionConfigurators === []
// Transaction and cleanup failures can invalidate a PDO even without session configurators.
return static::$sessionConfigurators === [] && ! static::sessionStateIsUnknown($pdo)
? $pdo
: $this->synchronizeSession($pdo, read: false);
}
Expand All @@ -376,7 +377,7 @@ public function getReadPdo(): PDO

$pdo = $this->resolveReadPdo();

return static::$sessionConfigurators === []
return static::$sessionConfigurators === [] && ! static::sessionStateIsUnknown($pdo)
? $pdo
: $this->synchronizeSession($pdo, read: true);
}
Expand Down
Loading
Loading