fix: seeder
Build and Push Docker Image only on Conventional Commits / build (push) Has been cancelled
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled

This commit is contained in:
Marian
2025-11-27 09:26:43 +00:00
parent 741655c548
commit aa8de00969
+19 -4
View File
@@ -3,8 +3,8 @@
namespace Database\Seeders;
use App\Models\User;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;
class DatabaseSeeder extends Seeder
{
@@ -13,12 +13,27 @@ class DatabaseSeeder extends Seeder
*/
public function run(): void
{
// User::factory(10)->create();
// Create initial admin user without using factory (production-safe)
User::firstOrCreate(
['email' => 'admin@example.com'],
[
'name' => 'Admin User',
'email' => 'admin@example.com',
'password' => Hash::make('password'),
'email_verified_at' => now(),
]
);
User::factory()->withoutTwoFactor()->create([
// Create test user
User::firstOrCreate(
['email' => 'test@example.com'],
[
'name' => 'Test User',
'email' => 'test@example.com',
]);
'password' => Hash::make('password'),
'email_verified_at' => now(),
]
);
// Note: Company and Transaction data is now synced from the backend
// via TransformDataPoolToProduction job, not seeded manually