An open API service indexing awesome lists of open source software.

https://github.com/dickidarmawansaputra/laravel-frankenphp

Laravel integration with FrankenPHP
https://github.com/dickidarmawansaputra/laravel-frankenphp

frankenphp laravel

Last synced: about 1 month ago
JSON representation

Laravel integration with FrankenPHP

Awesome Lists containing this project

README

          

# Laravel ❤️ FrankenPHP
![image](https://github.com/user-attachments/assets/af5f0fcf-2368-41be-bb53-2346a711d9ec)

## Stress Testing Tool
- [Pest Stress Testing](https://pestphp.com/docs/stress-testing)
- Command Stress Test
Stress testing with duration `10` seconds & concurrent requests `300`
```bash
./vendor/bin/pest stress http://localhost --duration=10 --concurrency=300
```

## Docker
Serving a Laravel web application with FrankenPHP is as easy as mounting the project in the /app directory of the official Docker image.
```bash
docker run -p 80:80 -p 443:443 -p 443:443/udp -v $PWD:/app dunglas/frankenphp
```

### Result Stress Test
image

## Local Installation
Run your Laravel projects with FrankenPHP from your local machine.
### Install FrankenPHP
- Install FrankenPHP
```bash
curl https://frankenphp.dev/install.sh | sh
mv frankenphp /usr/local/bin/
```
- Add the following configuration to a file named `Caddyfile` in the root directory of your Laravel project:
```caddyfile
{
frankenphp
}

# The domain name of your server
localhost {
# Set the webroot to the public/ directory
root * public/
# Enable compression (optional)
encode zstd br gzip
# Execute PHP files from the public/ directory and serve assets
php_server {
try_files {path} index.php
}
}
```

### Result Stress Test
- Command
```bash
php artisan serve
```
image

- Command
```bash
franken run
```
image

## Laravel Octane
Using Laravel Octane
### Install Laravel Octane via the Composer package manager
```bash
composer require laravel/octane
```

### Result Stress Test
- Command
```bash
php artisan octane:frankenphp
```
image

- Command:
```bash
php artisan octane:frankenphp --host=127.0.0.1 --port=8000 --workers=4
```
image

## Running Octane With Standalone Binaries
Run package Laravel Octane apps as standalone binaries.
```bash
PATH="$PWD:$PATH" frankenphp php-cli artisan octane:frankenphp
```

### Result Stress Test
image