kekalainen / eloquent-concurrency
Race condition workarounds for concurrent *OrCreate method calls.
1.0.1
2023-01-19 06:43 UTC
Requires
- php: >=7.4
- illuminate/database: >=5.4
- illuminate/support: >=5.4
This package is auto-updated.
Last update: 2024-10-19 10:23:49 UTC
README
Race condition workarounds for concurrent *OrCreate
method calls.
Usage
Apply the CanRunOrCreateConcurrently
trait to a model:
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use Kekalainen\EloquentConcurrency\CanRunOrCreateConcurrently; abstract class BaseModel extends Model { use CanRunOrCreateConcurrently; }
Limitations
- Only MySQL and MariaDB are supported.
- Relationship methods are not handled.