Fix deployment issues: Add db:seed to setup, fix DatabaseSeeder, add production guide

CRITICAL FIXES:
- DatabaseSeeder now calls RolePermissionSeeder to create roles, permissions, and admin user
- setup.sh and setup.bat now run db:seed automatically during setup
- Created PRODUCTION_DEPLOYMENT.md with complete production deployment guide
- Removed duplicate admin user creation from setup scripts

This ensures:
- Admin user (admin@example.com / password) is created automatically
- Roles (admin, editor, viewer) are created during setup
- Permissions are seeded properly
- Production deployments have clear step-by-step instructions
- PHP Redis extension installation documented
- All common deployment issues addressed

The 2-minute setup now truly works out of the box.
This commit is contained in:
2026-03-09 11:42:25 +02:00
parent ae410ca4da
commit 3fee3917c5
4 changed files with 497 additions and 20 deletions

View File

@@ -75,20 +75,18 @@ docker-compose exec app php artisan migrate --force
echo -e "${GREEN}✓ Migrations completed${NC}"
echo ""
# Step 7: Create storage link
# Step 7: Seed database (roles, permissions, admin user)
echo -e "${YELLOW}→ Seeding database (roles, permissions, admin user)...${NC}"
docker-compose exec app php artisan db:seed --force
echo -e "${GREEN}✓ Database seeded${NC}"
echo ""
# Step 8: Create storage link
echo -e "${YELLOW}→ Creating storage symlink...${NC}"
docker-compose exec app php artisan storage:link
echo -e "${GREEN}✓ Storage linked${NC}"
echo ""
# Step 8: Create admin user
echo -e "${YELLOW}→ Creating admin user...${NC}"
echo -e "${YELLOW} Email: admin@example.com${NC}"
echo -e "${YELLOW} Password: password${NC}"
docker-compose exec -T app php artisan make:filament-user --name=Admin --email=admin@example.com --password=password 2>/dev/null || echo -e "${YELLOW} (Admin user may already exist)${NC}"
echo -e "${GREEN}✓ Admin user ready${NC}"
echo ""
# Done!
echo ""
echo -e "${GREEN}╔════════════════════════════════════════════════════════╗${NC}"