Skip to content

kekalainen/eloquent-concurrency

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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