kekalainen/eloquent-concurrency

Race condition workarounds for concurrent *OrCreate method calls.

1.0.1 2023-01-19 06:43 UTC

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