Quick Start
#Let's go!
If you've already got your environment set up to build mobile apps using Xcode and/or Android Studio, then you can get building your first mobile app with NativePHP in minutes:
#1. Update your composer.json
Add the NativePHP Composer repository:
Copied!
"repositories": [ { "type": "composer", "url": "https://nativephp.composer.sh" }]
Running Composer 2.9+?
If you're running Composer 2.9 or above, you can just use a single command, instead of copy-pasting the above:
Copied!
composer repo add nativephp composer https://nativephp.composer.sh
#2. Set your app's identifier
You must set a NATIVEPHP_APP_ID in your .env file:
Copied!
NATIVEPHP_APP_ID=com.cocacola.cokezero
#3. Install & run
Copied!
# Install NativePHP for Mobile into a new Laravel appcomposer require nativephp/mobile # Ready your app to go nativephp artisan native:install # Run your app on a mobile devicephp artisan native:run
The native command
When you run native:install, NativePHP installs a native script helper that can be used as a convenient wrapper to
the native Artisan command namespace. Once this is installed you can do the following:
Copied!
# Instead of...php artisan native:run # Dophp native run # Or./native run