NativePHP Mobile: Build Real Native Apps With Laravel and PHP
NativePHP Mobile lets PHP developers build native iOS and Android apps using Laravel. Here's a practical guide to its APIs, setup, and native device features.
If someone had told you five years ago that you could build a native iOS app with PHP and Laravel, you would have laughed them out of the room. Yet here we are in 2026, and NativePHP Mobile is doing exactly that — and doing it well. It’s not a web wrapper or a glorified PWA. It embeds a full PHP runtime directly into native shell applications on both iOS and Android, giving you access to device APIs like the camera, biometrics, geolocation, and push notifications, all from the comfort of Blade templates and Livewire components.
If you’ve been watching NativePHP’s progress on the desktop side and wondering when mobile would become viable, the answer is now. Let’s walk through what NativePHP Mobile offers and how to start building with it.
How NativePHP Mobile Actually Works
The architecture behind NativePHP Mobile is more sophisticated than you might expect. It isn’t running a local web server on the phone. Instead, it uses four key components working together:
A statically-compiled PHP runtime gets bundled directly into a native shell application — Swift on iOS, Kotlin on Android. Native bridges specific to each platform manage the PHP environment and execute your code. A custom PHP extension exposes native device functions to your PHP code through a clean interface. Finally, a WebView renders your UI using familiar web technologies, but within a truly native container.
This means your Laravel app runs natively on the device, with full offline capability and on-device data storage. There’s no round-trip to a remote server for basic functionality. When the user opens your app, PHP boots up locally and starts serving your Blade views to the native WebView.
Getting Started
NativePHP Mobile requires a license (it’s proprietary software that funds the project’s development), PHP 8.3 or higher, and a standard Laravel application. Once you’ve purchased a license, setup is straightforward.
First, add the NativePHP private Composer repository:
{
"repositories": [
{
"type": "composer",
"url": "https://nativephp.composer.sh"
}
]
}
Then install the package:
composer require nativephp/mobile
You’ll authenticate with your license email and key during installation. Next, configure your .env file with your app identifier and version:
NATIVEPHP_APP_ID=com.yourcompany.yourapp
NATIVEPHP_APP_VERSION="DEBUG"
NATIVEPHP_APP_VERSION_CODE="1"
Run the installer and then launch:
php artisan native:install
php artisan native:run
That’s it. You’ll be prompted to select a connected device, and NativePHP will compile and deploy your app. For iOS, you’ll need Developer Mode enabled and a registered device in your Apple Developer account. For Android, enable USB debugging through developer options.
Accessing Native Device Features
This is where NativePHP Mobile really shines. The framework provides a set of Laravel Facades that wrap native device capabilities in a clean, testable API. If you’ve worked with Laravel at all, these will feel immediately familiar.
Biometric Authentication
Adding Face ID or fingerprint authentication to your app is remarkably simple:
use Native\Mobile\Facades\Biometrics;
Biometrics::prompt();
Handle the result in a Livewire component using the event system:
use Livewire\Attributes\On;
use Native\Mobile\Events\Biometric\Completed;
#[On('native:'.Completed::class)]
public function handleBiometric(bool $success)
{
if ($success) {
$this->unlockSecureFeature();
} else {
$this->showErrorMessage();
}
}
This works across both platforms — Face ID and Touch ID on iOS, fingerprint and face unlock on Android, with automatic fallback to system-level authentication like PIN or pattern.
Camera and Gallery Access
Capturing photos or letting users pick from their gallery follows the same pattern:
use Native\Mobile\Facades\Camera;
// Take a new photo
Camera::getPhoto();
// Pick existing images from gallery
Camera::pickImages('images', true); // true = allow multiple
Listen for results:
use Native\Mobile\Events\Camera\PhotoTaken;
#[On('native:'.PhotoTaken::class)]
public function handlePhoto(string $path)
{
// $path points to the captured image file
$this->processUpload($path);
}
Geolocation
Getting the user’s position is a single method call with a fine-accuracy toggle:
use Native\Mobile\Facades\Geolocation;
// Network-based (fast, less accurate)
Geolocation::getCurrentPosition();
// GPS-based (slower, more precise)
Geolocation::getCurrentPosition(fineAccuracy: true);
The LocationReceived event delivers latitude, longitude, accuracy in meters, a timestamp, and provider information. NativePHP also handles the permission flow for you — requestPermissions() and checkPermissions() let you manage the user experience around location access gracefully.
Push Notifications
NativePHP Mobile uses Firebase Cloud Messaging (FCM) under the hood for push notifications:
use Native\Mobile\Facades\PushNotifications;
PushNotifications::enroll();
Once the user grants permission, you receive an FCM token through the TokenGenerated event:
use Native\Mobile\Events\PushNotification\TokenGenerated;
#[On('native:'.TokenGenerated::class)]
public function handleToken(string $token)
{
// Send this token to your backend for storage
Http::post('/api/devices', ['token' => $token]);
}
Your backend server can then send push notifications to specific devices using the stored FCM tokens.
The Full Native API Surface
Beyond the examples above, NativePHP Mobile gives you Facades for haptic feedback and vibration (Haptics), encrypted key-value storage using the platform Keychain or Keystore (SecureStorage), native dialog boxes and toasts (Dialog), system information and flashlight control (System), and an in-app browser (Browser). Each follows the same Facade-plus-event pattern that makes the camera and biometrics APIs so clean.
Why This Matters for PHP Developers
The real significance of NativePHP Mobile isn’t just that it lets you write mobile apps in PHP. It’s that it lets you leverage your entire existing Laravel ecosystem — your Eloquent models, your Blade components, your Livewire interactivity, your middleware, your testing infrastructure — and deploy it as a native mobile application.
You don’t need to learn Swift, Kotlin, React Native, or Flutter. You don’t need to maintain separate codebases for web and mobile. You write Laravel code, use Livewire for reactivity, and NativePHP handles the bridge to native capabilities.
For agencies, freelancers, and small teams that already run on Laravel, this is a genuine path to mobile without hiring specialists or rewriting everything. The fact that apps run offline-first with on-device storage makes them viable for real production use cases, not just demos.
NativePHP Mobile is still a young project, but the API surface it already covers is impressive and the architecture is sound. If you’ve been waiting for a reason to take PHP mobile, this is it.