-
Notifications
You must be signed in to change notification settings - Fork 1
Home
See also Maravel Template Wiki and Maravelith Template Wiki
Notes:
-
Version 10.58.2 fixes typo and version number for 10.58.1
-
Version 10.58.1 adds {--fail-on-fatal : Fail the job on fatal error} to WorkCommand
-
Version 10.58.0 implements cache lock refresh, blocks calls from Model to Eloquent Builder from__call but allow from __callStatic and handles memory overflow in jobs by failing them when tries = 0
-
Version 10.57.0 introduces a fix for 10.55.0 regarding Illuminate\Console\GeneratorCommand and new features like registerExplicitBindingsMap and raw alias registration. More details.
-
Version 10.56.0 includes observers in event:cache command and improves the boot times for registering the event listeners for both events and observers. More details.
-
Version 10.55.1 fires -ing post-fixed events before commit when ShouldHandleEventsAfterCommit or $afterCommit = true are used in observers. More details.
-
Version 10.55.0 does not contain development commands anymore.
For backward compatibility run
composer require macropay-solutions/maravel-framework-dev --devwhen updating maravel-framework to version >=10.55.0 in Maravel or Maravelith.
- Version 10.54.3 restricts the devCommands to local environment and by doing this, it speeds up the boot of the application. Also it contains a back-port for \Illuminate\Console\Prohibitable with the mention that these classes are by default prohibited from running in production:
- \Illuminate\Database\Console\Migrations\FreshCommand
- \Illuminate\Database\Console\Migrations\MigrateMakeCommand
- \Illuminate\Database\Console\WipeCommand
- \Illuminate\Database\Console\Migrations\ResetCommand
- \Illuminate\Database\Console\Migrations\RefreshCommand
- \Illuminate\Database\Console\Seeds\SeedCommand
The differences to Laravel/Lumen are:
- allows Migration Rollback in production
- prohibits by default any command that uses the trait from running in production, unless coded otherwise via CommandFQN::prohibit(false);
- the devCommands will be registered only in local environment
- Version 10.54.0 adds to config/app.php
// Previous encryption keys to cypher map to be used for decryption...
'previous_keys_cipher_map' => (array)\json_decode((string)\env('APP_PREVIOUS_KEYS_CIPHERS_MAP_JSON', '[]'), true),-
Version 10.53.2 improves the update times by lowering the number of times set is called when using casts. See discussion. Also it enables (as a bonus) update lock for models.
-
Maravel-Framework v 10.51.17 contains an adaptation for an old PHP bug and v 10.51.18 a backward compatible fix for it.
-
From version 10.51.7
SQS FIFO and Fair Queues
Maravel framework supports Amazon SQS FIFO (First-In-First-Out) queues through message deduplication.
Maravel example:
\dispatch(new JobExample($payload))->onGroup('customer-' . $payload['customer_id']);Maravelith example:
JobExample::dispatch($payload)->onGroup('customer-' . $payload['customer_id']);Implement a deduplicationId method with string return type in your job to prevent for 5 minutes duplicate dispatches (if not, a default Str::orderedUuid()->toString() will be used meaning duplicates will be processed):
/**
* Get the job's deduplication ID.
*/
public function deduplicationId(): string
{
return 'prefix-' . $this->customId;
}-
From version 10.49.3, to prevent the parent script that runs the queue command from exiting with error due to memory exhausted, you should call it like:
php artisan queue:work || echo "error..."php artisan queue:listen || echo "error..." -
\Illuminate\Support\Facades\Queue::push should not be used in combination with ShouldBeUnique!
-
Eloquent accessors for columns used in relations are called with param null when a relation is instantiated so, they must be defined with ?string param and return type even if the column is not nullable in DB.
public function getColAttribute(?string $value): ?string
{
return \is_string($value) ? \strtolower($value) : null;
}- Avoid piling up email addresses when sending emails in a loop via queue with the same mailable:
$maillable = (new ChildMailable())->onQueue('emails');
foreach ([...] as $email) {
Mail::to($email)->queue($maillable);
$message->to = []; // without this the emails will pile up in the $maillable object
}
// or
foreach ([...] as $email) {
Mail::to($email)->queue((new ChildMailable())->onQueue('emails'));
}