Skip to content

Commit cce5ee0

Browse files
chore: ensure tests pass on laravel 11
1 parent 192a476 commit cce5ee0

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

workbench/app/Models/Role.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Illuminate\Database\Eloquent\Factories\HasFactory;
66
use Illuminate\Database\Eloquent\Model;
77
use Illuminate\Database\Eloquent\SoftDeletes;
8+
use Workbench\Database\Factories\RoleFactory;
89

910
class Role extends Model
1011
{
@@ -14,4 +15,9 @@ class Role extends Model
1415
protected $fillable = [
1516
'name',
1617
];
18+
19+
protected static function newFactory(): RoleFactory
20+
{
21+
return RoleFactory::new();
22+
}
1723
}

workbench/app/Models/User.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
88
use Illuminate\Foundation\Auth\User as Authenticatable;
99
use Illuminate\Notifications\Notifiable;
10+
use Workbench\Database\Factories\UserFactory;
1011

1112
class User extends Authenticatable
1213
{
@@ -52,4 +53,9 @@ public function roles(): BelongsToMany
5253
{
5354
return $this->belongsToMany(Role::class);
5455
}
56+
57+
protected static function newFactory(): UserFactory
58+
{
59+
return UserFactory::new();
60+
}
5561
}

workbench/storage

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)