Mozex Labs Documentation

website·Indexed 32 days ago

https://mozex.dev/docs

Developer resources and documentation for Laravel and PHP tools, including Anthropic PHP, Anthropic Laravel, Laravel Scout Bulk Actions, and Laravel Modules (v3). The site also features a technical blog covering Laravel performance, AI integration, and DevOps best practices.

Tokens
104.4K
Snippets
542
Records
719
Agent score
57%

What's inside Mozex

  1. Overview of Laravel Compose

    v1
    Laravel Compose allows a Laravel application to manage the Docker Compose stacks it depends on. It automates the regeneration of environment files from application configuration and handles the recreation of containers during deployment using a single Artisan command. This is particularly useful for apps that run sidecar services like search engines or API servers on the same host.
  2. Overview of Wispr Flow for Developers

    Wispr Flow is a system-wide voice-to-text tool that uses AI to transcribe speech and automatically edit it for professional use. Unlike standard transcription, it removes filler words, fixes grammar, adds punctuation, and restructures rambling thoughts into clear sentences. It is designed to work in any text field, including IDEs (VS Code, Cursor), terminals, Slack, and browsers.
  3. Overview of Laravel Modules v3 features

    v3
    Laravel Modules v3 automatically discovers and registers various features. Some features (Livewire, Filament, Nova) are only active if their respective packages are installed.
    FeatureDescriptionConfig Key
    ConfigsMerges module config files into Laravel's configconfigs
    Service ProvidersRegisters module service providersservice-providers
    HelpersLoads helper function files via require_oncehelpers
    CommandsRegisters Artisan commandscommands
    MigrationsAdds migration paths to Laravel's migratormigrations
    SeedersDiscovers module database seedersseeders
    TranslationsRegisters namespaced and JSON translationstranslations
    ViewsRegisters view namespaces and anonymous componentsviews
    Blade ComponentsRegisters class-based Blade componentsblade-components
    RoutesLoads route files with group-based middlewareroutes
    Models & FactoriesWires model-factory name guessingmodels, factories
    PoliciesWires model-policy name guessingpolicies
    Events & ListenersEnables event auto-discovery in moduleslisteners
    LivewireRegisters Livewire componentslivewire-components
    FilamentRegisters resources, pages, widgets, clustersfilament-*
    NovaRegisters Nova resourcesnova-resources
  4. Overview of Anthropic Server Tools

    v1
    Server tools are built-in tools executed by Claude automatically on Anthropic's infrastructure. Unlike custom tools, where the developer's code executes the tool, server tools are triggered by including them in the tools array of a request, and the results are returned directly in the API response.
  5. Retrieve a single model by ID

    v1
    Use Anthropic::models()->retrieve('model-id') to get detailed information about a specific Claude model, including its display name, creation date, and token limits.
    $response = Anthropic::models()->retrieve('claude-sonnet-4-6');
    
    $response->id;             // 'claude-sonnet-4-6'
    $response->displayName;    // 'Claude Sonnet 4.6'
    $response->createdAt;      // '2025-05-14T00:00:00Z'
    $response->maxInputTokens; // 200000
    $response->maxTokens;      // 64000
  6. Database and Storage isolation in Laravel Test Lanes

    v1

    Laravel Test Lanes provides isolation for concurrent test processes:

    • Databases: Each process claims a machine-unique lane via a database advisory lock. Databases are named using the pattern {base}_test_lane{n}. This prevents multiple concurrent runs in one project from sharing a database.
    • Drivers: Postgres, MySQL, and MariaDB are supported by default. Custom drivers can be supported by providing AdvisoryLock implementations in the locks configuration map.
    • SQLite: In-memory SQLite suites are ignored to mirror standard Laravel behavior.
    • Storage: Storage::fake() roots are lane-scoped, preventing concurrent runs from deleting each other's fake-disk files.
  7. Use Prism PHP for fluent multi-provider AI integration

    Prism (prism-php/prism) is a mature multi-provider AI package that uses a fluent builder pattern instead of agent classes. It is a battle-tested alternative to the Laravel AI SDK, offering a thorough ecosystem and a fluent API for chaining configuration calls.
  8. Automatically register Artisan commands in modules

    v3
    Laravel Modules v3 automatically discovers and registers any non-abstract class that extends Illuminate\Console\Command located within the configured command paths. Abstract base commands are ignored by the scanner, allowing for shared base classes that do not appear in the php artisan list output.
  9. Install and configure mozex/laravel-modules

    The mozex/laravel-modules package allows for a modular Laravel architecture where features are grouped by domain (e.g., Modules/Blog, Modules/Billing) rather than by type. It uses auto-discovery based on directory structure, removing the need for manual service provider registration or module manifest files.
    composer require mozex/laravel-modules

    Add to composer.json

    { "autoload": { "psr-4": { "App": "app/", "Modules": "Modules/", "Database\Seeders": "database/seeders/" } } }

    Then run

    composer dump-autoload

  10. Manage Docker Compose stacks with Laravel Compose

    v1
    Laravel Compose allows a Laravel application to own its Docker Compose stacks and recreate them during deployment. Stacks are defined as directories containing a docker-compose.yml file and an optional Stack class. By default, the package discovers stacks in app/Docker/* and Modules/*/Docker.
  11. Implement zero-downtime deployment for Laravel

    Zero-downtime deployment prevents application breakage during updates by using a directory structure where each deployment is placed in a unique timestamped folder under releases/. A current symlink is atomically switched to the new release only after all build and configuration steps are complete. A shared storage/ directory is symlinked across all releases to persist logs, uploads, and disk-based caches.
    /home/user/example.com/
    ├── current -> releases/20260331120000
    ├── releases/
    │   ├── 20260331120000/   ← active release
    │   ├── 20260330150000/   ← previous release
    │   └── 20260329090000/   ← older release
    └── storage/              ← shared across all releases