Admin Panel Setup Guide
This guide covers how to set up and use the Laravel Filament admin panel for the EasyOTC API.
Where to access
| Environment | URL |
|---|---|
| Local | http://localhost:8000/admin |
| Staging | https://stage-api.easyotc.com/admin |
- Required role:
OTC_ONE_ADMIN(seeapp/Enums/RoleEnum.php). No other role can sign in to the Filament panel. - Repo:
https://github.com/Eliinova/the-one-otc-api - Panel provider:
app/Providers/Filament/AdminPanelProvider.php - Resources:
app/Filament/Resources/ - Run locally:
php artisan servefrom thethe-one-otc-apirepo root, then open/admin.
See /access for the full list of environment URLs and shared credentials.
Prerequisites
- PHP 8.4+
- Composer 2.8+
- Node.js 22+
- Bun 1.2+
- PostgreSQL 13+
- Redis 8.0+
- Meilisearch 1.15+
Initial Setup
1. Install Dependencies
composer install
npm install2. Environment Configuration
Copy the environment file and configure your database:
cp .env.example .env
php artisan key:generateUpdate your .env file with your database credentials:
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=otc_api
DB_USERNAME=your_username
DB_PASSWORD=your_password3. Database Setup
Run migrations and seed the database with initial data:
php artisan migrate:fresh --seedImportant: Always ensure php artisan db:seed is run to populate the database with necessary seed data including:
- Roles and permissions
- Sample carriers
- Sample users
- Sample products
- Sample members
Authentication
Admin Panel Access
Important: Only users with the OTC_ONE_ADMIN role can access the Filament admin panel. Regular CARRIER_ADMIN and MEMBER users do not have access to the admin interface.
Use the following OTC_ONE_ADMIN credentials:
Email: superadmin@easyotc.com
Password: password
Accessing the Admin Panel
Start your Laravel development server:
bashphp artisan serveNavigate to the admin panel:
Environment URL Local http://localhost:8000/adminStaging https://stage-api.easyotc.com/adminSee /access for all environments.
Login with the OTC_ONE_ADMIN credentials above
Admin Panel Features
User Management
- Location: User Management → Users
- Features:
- Create, edit, and delete users
- Assign roles (OTC_ONE_ADMIN, CARRIER_ADMIN, MEMBER, AGENT)
- Manage user status (active/inactive)
- View user relationships with members
- Email verification status
- Note: Only OTC_ONE_ADMIN users can access this interface
Carrier Management
- Location: Carrier Management → Carriers
- Features:
- Create and manage insurance carriers
- Set carrier domains and slugs
- Upload carrier logos
- Configure carrier-specific settings
- View member counts per carrier
- Note: Only OTC_ONE_ADMIN users can access this interface
Member Management
- Location: Member Management → Members
- Features:
- Create and manage insurance members
- Link members to users and carriers
- Manage member personal information
- Handle address and contact details
- View cart relationships
- Note: Only OTC_ONE_ADMIN users can access this interface
Key Features
Role-Based Access Control
Roles are defined in app/Enums/RoleEnum.php:
- OTC_ONE_ADMIN: Full access to the admin panel and all features
- CARRIER_ADMIN: Carrier-scoped admin; can impersonate members (API access only, no admin panel access)
- AGENT: Agent-level access (API only, no admin panel access)
- MEMBER: Standard user access (no admin panel access)
Data Relationships
- Users can have multiple roles
- Members belong to carriers
- Members are linked to user accounts
- Carts are associated with members
Security Features
- Soft deletes for data protection
- Relationship validation (prevents deletion of records with dependencies)
- Email verification tracking
- Active/inactive status management
Troubleshooting
Common Issues
"Cannot access admin panel"
- Ensure you're using the OTC_ONE_ADMIN credentials
- Check that the user has the
OTC_ONE_ADMINrole - Note:
CARRIER_ADMIN,AGENT, andMEMBERusers cannot access the Filament admin panel
"No data showing"
- Run
php artisan db:seedto populate the database - Check that migrations have been run successfully
- Run
"Permission denied"
- Verify the user has the correct role assigned
- Check the
canAccessPanelmethod in the User model
Useful Commands
# Clear all caches
php artisan config:clear
php artisan cache:clear
php artisan route:clear
php artisan view:clear
# Regenerate autoload files
composer dump-autoload
# Check application status
php artisan aboutAdditional Resources
For more information about Laravel Filament features and customization, visit the official documentation:
- Laravel Filament Documentation: https://filamentphp.com/docs
- Filament Forms: https://filamentphp.com/docs/3.x/forms/installation
- Filament Tables: https://filamentphp.com/docs/3.x/tables/installation
- Filament Resources: https://filamentphp.com/docs/3.x/panels/resources/getting-started
Development Notes
- The admin panel is located at
/adminroute - All resources are automatically discovered from
app/Filament/Resources/ - Custom pages can be added in
app/Filament/Pages/ - The admin panel uses the
adminpanel configuration inapp/Providers/Filament/AdminPanelProvider.php