v7.0.0-beta.4 release
This commit is contained in:
1 parent
05db17887d
commit
1db039ff34
1545 files changed
+136783
-11634
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Enums\UserStatus;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Str;
|
||||
@@ -23,6 +24,10 @@ class UserFactory extends Factory
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
// status: DB default 는 'active' 이지만 factory create 시 in-memory 인스턴스에는
|
||||
// default 가 반영되지 않아 `$user->status === null` 상태가 된다. 이 인스턴스를
|
||||
// actingAs() 로 세팅하면 CheckUserStatus 미들웨어가 null !== 'active' 로 판정해
|
||||
// 403 을 반환하므로, factory 단에서 명시 지정하여 production-like 완전 상태로 생성한다.
|
||||
return [
|
||||
'uuid' => Str::orderedUuid()->toString(),
|
||||
'name' => fake()->name(),
|
||||
@@ -31,6 +36,7 @@ class UserFactory extends Factory
|
||||
'password' => static::$password ??= Hash::make('password'),
|
||||
'remember_token' => Str::random(10),
|
||||
'is_super' => false,
|
||||
'status' => UserStatus::Active->value,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user