added club create and edit modal
This commit is contained in:
1 parent
a4bc983660
commit
da688375e3
38 files changed
+9194
-44
No files matched your search
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('tenants', function (Blueprint $table) {
|
||||
// Add established_date if it doesn't exist
|
||||
if (!Schema::hasColumn('tenants', 'established_date')) {
|
||||
$table->date('established_date')->nullable()->after('description');
|
||||
}
|
||||
|
||||
// Add status if it doesn't exist
|
||||
if (!Schema::hasColumn('tenants', 'status')) {
|
||||
$table->string('status')->default('active')->after('settings');
|
||||
}
|
||||
|
||||
// Add public_profile_enabled if it doesn't exist
|
||||
if (!Schema::hasColumn('tenants', 'public_profile_enabled')) {
|
||||
$table->boolean('public_profile_enabled')->default(true)->after('status');
|
||||
}
|
||||
});
|
||||
|
||||
Schema::table('club_bank_accounts', function (Blueprint $table) {
|
||||
// Add benefitpay_account if it doesn't exist
|
||||
if (!Schema::hasColumn('club_bank_accounts', 'benefitpay_account')) {
|
||||
$table->string('benefitpay_account')->nullable()->after('swift_code');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('tenants', function (Blueprint $table) {
|
||||
$table->dropColumn(['established_date', 'status', 'public_profile_enabled']);
|
||||
});
|
||||
|
||||
Schema::table('club_bank_accounts', function (Blueprint $table) {
|
||||
$table->dropColumn('benefitpay_account');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\User;
|
||||
use App\Models\Role;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class SuperAdminSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// Create Super Admin User
|
||||
$superAdmin = User::firstOrCreate(
|
||||
['email' => '[email protected]'],
|
||||
[
|
||||
'name' => 'Super Administrator',
|
||||
'full_name' => 'Super Administrator',
|
||||
'password' => Hash::make('SuperAdmin@2024'),
|
||||
'email_verified_at' => now(),
|
||||
'mobile' => ['code' => '+971', 'number' => '501234567'],
|
||||
'gender' => 'male',
|
||||
'nationality' => 'UAE',
|
||||
]
|
||||
);
|
||||
|
||||
// Assign super-admin role
|
||||
$superAdminRole = Role::where('slug', 'super-admin')->first();
|
||||
|
||||
if ($superAdminRole) {
|
||||
// Check if role is already assigned
|
||||
if (!$superAdmin->hasRole('super-admin')) {
|
||||
$superAdmin->roles()->attach($superAdminRole->id, ['tenant_id' => null]);
|
||||
$this->command->info('Super admin role assigned successfully!');
|
||||
} else {
|
||||
$this->command->info('User already has super admin role.');
|
||||
}
|
||||
} else {
|
||||
$this->command->error('Super admin role not found. Please run RolePermissionSeeder first.');
|
||||
}
|
||||
|
||||
$this->command->info('Super Admin User Created:');
|
||||
$this->command->info('Email: [email protected]');
|
||||
$this->command->info('Password: SuperAdmin@2024');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user