Skip to content

Commit

Permalink
improve development experience
Browse files Browse the repository at this point in the history
  • Loading branch information
rahmanramsi committed Nov 25, 2023
1 parent 0836e28 commit a2e7359
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Models/Enums/Concern/UsefulEnums.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ public static function array(): array

public static function random(): static
{
return self::fromValue(self::values()[array_rand(self::values())]);
return self::from(self::values()[array_rand(self::values())]);
}
}
4 changes: 3 additions & 1 deletion database/seeders/Developments/UserSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public function run(): void

$user->assignRole(UserRole::Admin->value);

\App\Models\User::factory(100)->create();
$users = \App\Models\User::factory(100)->create();

$users->each(fn($user) => $user->assignRole(UserRole::random()->value));
}
}

0 comments on commit a2e7359

Please sign in to comment.