Laravel Octane supercharges your application's performance by serving your application using high-powered application servers, such as Swoole, RoadRunner, and FrankenPHP. Octane boots your application once, keeps it in memory, and then feeds it requests at supersonic speeds. For more information, visit Laravel Octane Documentation.
- Performance Boost: By keeping your application in memory and serving requests using high-performance servers, Octane significantly reduces the response time and increases the throughput of your application.
- Reduced Latency: Octane reduces the latency of your application by eliminating the need to boot the framework from scratch for every request.
- Efficient Resource Utilization: With Octane, you can handle more requests with fewer resources, making your application more efficient and cost-effective.
- Scalability: Octane makes it easier to scale your application horizontally by distributing the load across multiple workers.
- Improved Developer Experience: Octane provides a seamless development experience with features like hot reloading, which automatically reloads your application when you make changes to the code.
- Install Dependencies:
- Run
composer install
to install the dependencies. - Run
npm install
to install the dependencies.
- Run
- Start the Development Server:
- Run
php artisan octane:start
to start the Octane server. - Run
npm run dev
to start the Vite server.
- Run
- Access the Application:
- Open your web browser and navigate to
http://localhost:8000
.
- Open your web browser and navigate to
Laravel Sail is a lightweight command-line interface for interacting with Laravel's default Docker development environment. You can use Sail to run Laravel Octane in a Docker container.
-
Install Laravel Sail:
- Run
composer require laravel/sail --dev
to add Sail as a development dependency. - Run
php artisan sail:install
to install Sail.
- Run
-
Start the Sail Environment:
- Run
./vendor/bin/sail up
to start the Docker containers.
- Run
-
Install Octane:
- Run
./vendor/bin/sail composer require laravel/octane
to add Octane to your project. - Run
./vendor/bin/sail artisan octane:install
to install Octane.
- Run
-
Start the Octane Server:
- Run
./vendor/bin/sail artisan octane:start
to start the Octane server within the Sail environment.
- Run
-
Access the Application:
- Open your web browser and navigate to
http://localhost
to access your application running with Octane in the Sail environment.
- Open your web browser and navigate to
By using Laravel Sail, you can easily set up and run Laravel Octane in a Dockerized environment, ensuring a consistent development setup across different machines.
To configure the Octane server, you can use the octane:start
command with the --server
option. For example, to start the Octane server with the FrankenPHP server, run:
php artisan octane:start --server=FrankenPHP
🎀 You Can use docker directly, run
docker compose up -d
For more information on configuring and using Laravel Octane, visit the Laravel Octane Documentation.