Introduction to NativePHP for Mobile
mainNativePHP for Mobile allows you to run full PHP applications natively on iOS and Android devices without requiring a web server. It works by embedding a statically compiled PHP runtime alongside your Laravel application and bridging it to native platform APIs.
Key Features
- No Web Server Required: The application runs entirely on-device and is capable of offline-first operation.
- Cross-Platform: Build for both iOS and Android from a single PHP codebase.
- Native Performance: Uses an embedded PHP runtime optimized for each mobile platform.
- Laravel Ecosystem: Leverages existing Laravel skills and tools.
How it Works
- A statically-compiled PHP runtime is bundled into a Swift (iOS) or Kotlin (Android) shell application.
- Custom Swift/Kotlin bridges manage the PHP environment and execute your code.
- A custom PHP extension exposes native functions as PHP interfaces.
- The UI is rendered in a native web view, allowing you to use your existing web development workflows.