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) andpackage.json(frontend assets), both at the repo root - Install command:
composer install && bun install(run from thethe-one-otc-apirepo 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
- Purpose: Allows admins to impersonate users for testing and support
- Features:
- Secure user impersonation
- Audit logging of impersonation sessions
- Middleware protection
- GitHub: lab404/laravel-impersonate
- Documentation: Lab404 Impersonate Docs
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
- Purpose: Record change logs from models in Laravel
- Features:
- Model change tracking
- Audit trail generation
- Discrepancy detection
- Business anomaly identification
- GitHub: owen-it/laravel-auditing
- Documentation: Laravel Auditing Docs
Installation Commands
To install all dependencies:
bash
# Install PHP dependencies
composer install
# Install frontend dependencies (if working with assets)
npm install
# or
bun installConfiguration
Most packages are configured through Laravel's configuration system. Key configuration files:
config/auth.php- Authentication configurationconfig/permission.php- Spatie Permission settingsconfig/laravel-impersonate.php- Impersonation settingsconfig/scout.php- MeiliSearch configurationconfig/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:
- Ensure compatibility with current Laravel version
- Add proper documentation
- Update this page with package information
- Include security considerations
- Add appropriate tests