nativephp / parcel
Laravel PHAR bundler for NativePHP applications with cross-platform path handling and optimization features
Requires
- php: ^8.2
- composer-runtime-api: ^2.0
- ext-json: *
- ext-openssl: *
- ext-phar: *
- humbug/box: ^4.7.1
- symfony/console: ^6.4|^7.0
- symfony/filesystem: ^6.4|^7.0
- symfony/process: ^6.4|^7.0
Requires (Dev)
- laravel/pint: ^1.22
- pestphp/pest: ^2.36
- phpstan/phpstan: ^2.1
Suggests
- ext-bz2: For bzip2 compressed PHAR files
- ext-zlib: For compressed PHAR files
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-20 01:42:59 UTC
README
A Laravel PHAR bundler designed specifically for NativePHP applications. Parcel provides specialized tools for packaging Laravel applications into PHAR files with proper path handling and NativePHP-specific optimizations.
Installation
Install Parcel globally via Composer:
composer global require nativephp/parcel
Make sure your global Composer bin directory is in your PATH.
Usage
Quick Start
Navigate to your Laravel project and run:
parcel prepare parcel compile
Individual Commands
1. Prepare Project (Recommended)
parcel prepare
This combines both preparation steps:
- Pushes NativePHP-specific stub files to your project
- Patches composer.json for PHAR compatibility
- Creates optimized Box configuration
2. Manual Steps (Optional)
If you prefer to run steps individually:
# Push stub files and configuration parcel push-stubs # Patch composer.json parcel patch-composer
3. Compile PHAR
parcel compile
This will:
- Use Box to compile your Laravel project into a PHAR
- Apply NativePHP path fixes automatically
- Create an optimized bundle in the
build/directory
Features
- RealPathMod Compactor: Automatically fixes
realpath()calls for PHAR compatibility - NativePHP Path Helper: Cross-platform path normalization with
nativephp_rp()function - PHAR Router: Web server routing for Laravel applications running from PHAR
- Optimized Configuration: Pre-configured Box settings for Laravel applications
Requirements
- PHP 8.2+
- Composer
- humbug/box (automatically handled)
Commands
parcel prepare [target-dir]
Prepares a Laravel project for PHAR compilation by running both push-stubs and patch-composer.
Arguments:
target-dir- Target Laravel project directory (default: current directory)
Options:
--force, -f- Overwrite existing files
parcel push-stubs [target-dir]
Pushes NativePHP stubs and configuration to a Laravel project.
Arguments:
target-dir- Target Laravel project directory (default: current directory)
Options:
--force, -f- Overwrite existing files
parcel patch-composer [target-dir]
Patches composer.json for NativePHP PHAR compilation.
Arguments:
target-dir- Target Laravel project directory (default: current directory)
parcel compile [working-dir]
Compiles a Laravel project into a PHAR using Box.
Arguments:
working-dir- Working directory for compilation (default: current directory)
Options:
--config, -c- Path to box.json configuration file--debug- Enable debug output
Contributing
See CONTRIBUTING.md. Please report security issues as described in SECURITY.md, not in public issues.
License
Parcel is open-source software licensed under the MIT license.