Skip to content

Packages & Dependencies

This project uses several key packages to implement specific features and functionality. Below is an overview of the main dependencies and their purposes.

Where this lives

  • Repo: https://github.com/Eliinova/the-one-otc-api (EasyOTC API)
  • Manifest files: composer.json (PHP) and package.json (frontend assets), both at the repo root
  • Install command: composer install && bun install (run from the the-one-otc-api repo root)
  • Role enum reference: app/Enums/RoleEnum.php

See /access for environment URLs and credentials.

Core Framework

Laravel 12

  • Purpose: The main PHP framework providing the foundation for the application
  • Features: Routing, middleware, authentication, database ORM, caching, and more
  • Documentation: Laravel Documentation

Authentication & Authorization

Laravel Sanctum

  • Purpose: API token authentication for SPA and mobile applications
  • Features: Token-based authentication, CSRF protection, session handling
  • Documentation: Laravel Sanctum

Spatie Laravel Permission

  • Purpose: Role-based access control and permissions management
  • Features:
    • Define roles and permissions
    • Assign permissions to roles
    • Check permissions in controllers and views
    • OTC_ONE_ADMIN bypass via Gate::before
  • GitHub: spatie/laravel-permission
  • Documentation: Spatie Permission Docs

User Management

Lab404 Laravel Impersonate

Search & Indexing

MeiliSearch PHP

  • Purpose: Fast and relevant search functionality for products and entities
  • Features:
    • Typo-tolerant search
    • Fast search results
    • Faceted search capabilities
    • Real-time indexing
  • GitHub: meilisearch/meilisearch-php
  • Documentation: MeiliSearch PHP Docs

Auditing & Logging

Owen It Laravel Auditing

Installation Commands

To install all dependencies:

bash
# Install PHP dependencies
composer install

# Install frontend dependencies (if working with assets)
npm install
# or
bun install

Configuration

Most packages are configured through Laravel's configuration system. Key configuration files:

  • config/auth.php - Authentication configuration
  • config/permission.php - Spatie Permission settings
  • config/laravel-impersonate.php - Impersonation settings
  • config/scout.php - MeiliSearch configuration
  • config/audit.php - Laravel Auditing settings

Version Compatibility

This project is tested with:

  • PHP: 8.2+
  • Laravel: 12.x
  • PostgreSQL: 13+
  • Node.js: 18+

Security Considerations

  • All packages are regularly updated for security patches
  • Laravel Sanctum provides secure API authentication
  • Spatie Permission ensures proper access control
  • User impersonation is logged and audited
  • Laravel Auditing provides comprehensive change tracking
  • Environment variables are used for sensitive configuration

Contributing

When adding new packages:

  1. Ensure compatibility with current Laravel version
  2. Add proper documentation
  3. Update this page with package information
  4. Include security considerations
  5. Add appropriate tests