added the listing of the clubs but didnt succseed

This commit is contained in:
ghassan committed 2026-01-22 04:44:25 +03:00
1 parent 0efe1f69e5
commit 59ad30575c
12 files changed
+737 -124

No files matched your search

+41 -2
View File
@@ -3,6 +3,9 @@
namespace Database\Seeders;
use App\Models\User;
use App\Models\Tenant;
use App\Models\Membership;
use App\Models\Invoice;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
@@ -17,11 +20,47 @@ class DatabaseSeeder extends Seeder
{
// User::factory(10)->create();
User::factory()->create([
'name' => 'Test User',
$user = User::firstOrCreate([
'email' => '[email protected]',
], [
'name' => 'Test User',
'full_name' => 'Test User',
'mobile' => ['code' => '+1', 'number' => '1234567890'],
'password' => bcrypt('password'),
]);
// Create a tenant (club)
$tenant = Tenant::create([
'owner_user_id' => $user->id,
'club_name' => 'Test Club',
'slug' => 'test-club',
]);
// Create membership
Membership::create([
'user_id' => $user->id,
'tenant_id' => $tenant->id,
'status' => 'active',
]);
// Create a paid invoice
Invoice::create([
'tenant_id' => $tenant->id,
'student_user_id' => $user->id,
'payer_user_id' => $user->id,
'amount' => 50.00,
'status' => 'paid',
'due_date' => now()->addDays(30),
]);
// Create a pending invoice
Invoice::create([
'tenant_id' => $tenant->id,
'student_user_id' => $user->id,
'payer_user_id' => $user->id,
'amount' => 25.00,
'status' => 'pending',
'due_date' => now()->addDays(15),
]);
}
}