Skip to content

Commit 2c03c66

Browse files
committed
fix l5.5 uuid
1 parent 512ed0f commit 2c03c66

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/MagicLink.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Carbon\Carbon;
66
use Illuminate\Database\Eloquent\Model;
77
use Illuminate\Database\QueryException;
8+
use Illuminate\Support\Facades\App;
89
use Illuminate\Support\Facades\Event;
910
use Illuminate\Support\Str;
1011
use MagicLink\Actions\ActionInterface;
@@ -22,9 +23,9 @@ protected static function boot()
2223
parent::boot();
2324

2425
static::creating(function ($model) {
25-
$model->id = method_exists(new Str(), 'uuid')
26-
? (string) Str::uuid()
27-
: \Ramsey\Uuid\Uuid::uuid4();
26+
$model->id = preg_match('/5\.5\.*/', App::version())
27+
? (string) \Ramsey\Uuid\Uuid::uuid4()
28+
: (string) Str::uuid();
2829
});
2930
}
3031

0 commit comments

Comments
 (0)