Skip to content

Laravel Integration ​

Nexphant runtime can orchestrate and run traditional Laravel applications with extremely low latency. This is achieved via a dedicated bridge adapter package: nexphant/laravel-adapter.

Performance Advantage ​

By keeping the Laravel application booted in memory between HTTP requests:

  • Avoids bootstrapping the Laravel framework container, loading service providers, and parsing route files on every single request.
  • Bypasses the traditional CGI / FPM process creation overhead.
  • Achieves sub-millisecond response latency.

Getting Started ​

1. Install Adapter in Laravel Project ​

Run composer require in your existing Laravel project directory:

bash
composer require nexphant/laravel-adapter

Laravel's package discovery will auto-discover the NexphantServiceProvider.

2. Publish Configuration ​

Publish the nexphant.php configuration file:

bash
php artisan nexphant:install

This creates config/nexphant.php which allows tuning the host, port, worker count, and other persistent server parameters.

3. Start the Server ​

Run the artisan command to start the Nexphant server:

bash
php artisan nexphant:start

The application will start listening on the configured port (default 8000).

Configuration Options ​

You can edit config/nexphant.php to customize how the server runs:

php
return [
    'host' => env('NEXPHANT_HOST', '0.0.0.0'),
    'port' => (int) env('NEXPHANT_PORT', 8000),
    'workers' => (int) env('NEXPHANT_WORKERS', 4),
    'max_requests' => (int) env('NEXPHANT_MAX_REQUESTS', 10000),
];

Next Steps ​

Released under the MIT License.