3.2 KiB
3.2 KiB
Setup Affiliations Enhancement
This guide will help you set up the enhanced affiliations feature with dummy data.
Step 1: Run Migrations
Run the new migrations to enhance the database schema:
php artisan migrate
This will:
- Add
start_date,end_date,package_id,activity_id,instructor_id, andnotescolumns toskill_acquisitionstable - Add
club_affiliation_idcolumn toclub_member_subscriptionstable
Step 2: Seed Dummy Data
Run the seeder to populate affiliations data for all users:
php artisan db:seed --class=AffiliationsDataSeeder
This will create for each user:
- 2-4 club affiliations with realistic date ranges
- Multiple packages per affiliation
- Activities within each package
- Skills learned from each activity
- Instructor assignments for each skill
- Cross-club skill progression (skills that started in one club and continued in another)
- Affiliation media (certificates, photos)
Step 3: View the Results
Navigate to the profile page:
http://127.0.0.1:8000/profile
Click on the Affiliations tab to see:
- Timeline of club memberships
- Skills wheel showing skills per club
- Detailed affiliation information including:
- Package history
- Activities and instructors
- Skill acquisition timeline
- Cross-club skill progression
What the Seeder Creates
For Each User:
- 2-4 Club Affiliations spanning different time periods
- 2-3 Packages per Affiliation with realistic start/end dates
- 2-4 Activities per Package (Martial Arts, Boxing, Fitness classes)
- 1-3 Skills per Activity taught by specific instructors
- Cross-Club Skills (25% chance) - skills that continue across different clubs
- 1-3 Media Items per affiliation (certificates, photos, documents)
Sample Clubs:
- Elite Martial Arts Academy (Manama)
- Champions Boxing Club (Riffa)
- Fitness First Gym (Seef)
- Warrior Taekwondo Center (Muharraq)
Sample Skills:
Martial Arts:
- Taekwondo Basics, Forms, Sparring
- Boxing Fundamentals, Footwork, Combinations
- Karate Kata, Kumite
- Self-Defense Techniques
- Kickboxing, Muay Thai, Jiu-Jitsu
Fitness:
- Weight Training, Cardio Conditioning
- HIIT Training, CrossFit
- Functional Training, Core Strengthening
- Flexibility & Stretching
- Nutrition Planning
Sample Instructors:
- Master Ahmed Al-Khalifa
- Coach Sarah Johnson
- Sensei Mohammed Ali
- Coach David Martinez
- Master Fatima Hassan
- And more...
Troubleshooting
If you encounter any errors:
- Migration errors: Make sure all previous migrations have run successfully
- Foreign key errors: Ensure the related tables (tenants, users, club_packages, etc.) exist
- No users found: Create some users first before running the seeder
Next Steps
After seeding the data, you can:
- View the enhanced affiliations tab
- Test the skill timeline visualization
- Check cross-club skill progression
- Verify instructor information displays correctly
- Review package history within each affiliation
Clean Up (Optional)
To remove all seeded data and start fresh:
# This will remove all affiliations data
php artisan db:seed --class=AffiliationsDataSeeder --force
Or to reset the entire database:
php artisan migrate:fresh --seed