Skip to content

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

EnvironmentURL
Localhttp://localhost:8000/admin
Staginghttps://stage-api.easyotc.com/admin
  • Required role: OTC_ONE_ADMIN (see app/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 serve from the the-one-otc-api repo 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

bash
composer install
npm install

2. Environment Configuration

Copy the environment file and configure your database:

bash
cp .env.example .env
php artisan key:generate

Update your .env file with your database credentials:

env
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=otc_api
DB_USERNAME=your_username
DB_PASSWORD=your_password

3. Database Setup

Run migrations and seed the database with initial data:

bash
php artisan migrate:fresh --seed

Important: 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

  1. Start your Laravel development server:

    bash
    php artisan serve
  2. Navigate to the admin panel:

    EnvironmentURL
    Localhttp://localhost:8000/admin
    Staginghttps://stage-api.easyotc.com/admin

    See /access for all environments.

  3. 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

  1. "Cannot access admin panel"

    • Ensure you're using the OTC_ONE_ADMIN credentials
    • Check that the user has the OTC_ONE_ADMIN role
    • Note: CARRIER_ADMIN, AGENT, and MEMBER users cannot access the Filament admin panel
  2. "No data showing"

    • Run php artisan db:seed to populate the database
    • Check that migrations have been run successfully
  3. "Permission denied"

    • Verify the user has the correct role assigned
    • Check the canAccessPanel method in the User model

Useful Commands

bash
# 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 about

Additional Resources

For more information about Laravel Filament features and customization, visit the official documentation:

Development Notes

  • The admin panel is located at /admin route
  • All resources are automatically discovered from app/Filament/Resources/
  • Custom pages can be added in app/Filament/Pages/
  • The admin panel uses the admin panel configuration in app/Providers/Filament/AdminPanelProvider.php