|
| 1 | +--- |
| 2 | +title: App Assets |
| 3 | +order: 400 |
| 4 | +--- |
| 5 | + |
| 6 | +## Customizing Your App Icon |
| 7 | + |
| 8 | +NativePHP makes it easy to apply a custom app icon to your iOS and Android builds. |
| 9 | + |
| 10 | +### Step 1: Provide Your Icon |
| 11 | + |
| 12 | +Place a single high-resolution icon file at: `public/icon.png` |
| 13 | + |
| 14 | + |
| 15 | +### Requirements: |
| 16 | +- Format: PNG |
| 17 | +- Size: 1024 × 1024 pixels |
| 18 | +- Shape: Square |
| 19 | +- Background: Transparent or solid — your choice |
| 20 | + |
| 21 | +Note: This image will be automatically resized for all Android densities and used as the base iOS app icon. |
| 22 | + |
| 23 | +--- |
| 24 | + |
| 25 | +## Compiling CSS and JavaScript |
| 26 | + |
| 27 | +Your device behaves like a server, so assets must be compiled before deployment. |
| 28 | + |
| 29 | +To ensure your latest styles and JavaScript are included, run: `npm run build` before running: `php artisan native:run`. |
| 30 | + |
| 31 | +If you’ve made changes to your frontend, this step is required to see them reflected in the app. |
| 32 | + |
| 33 | +--- |
| 34 | + |
| 35 | +## Using the --watch Flag (Experimental) |
| 36 | + |
| 37 | +NativePHP includes an experimental `--watch` flag that enables automatic file syncing while the app is running: |
| 38 | + |
| 39 | +php artisan native:run --watch |
| 40 | + |
| 41 | +This is useful during development for quickly testing changes without rebuilding the entire app. |
| 42 | + |
| 43 | +### Caveats |
| 44 | + |
| 45 | +- This feature is currently best suited for **Blade** and **Livewire** applications. |
| 46 | +- It does **not** currently detect or sync **compiled frontend assets**, such as those built with Vite or used by **Inertia.js**. |
| 47 | +- If you're working with a JavaScript-heavy stack (Vue, React, Inertia), you should continue using `npm run build` before launching the app with `native:run`. |
| 48 | + |
| 49 | +### Recommendation |
| 50 | + |
| 51 | +Use `--watch` when you're iterating on Blade views or Livewire components. For all other use cases, treat this flag as experimental and optional. |
| 52 | + |
| 53 | +--- |
| 54 | + |
| 55 | +## Optional: Installing with ICU Support |
| 56 | + |
| 57 | +By default, NativePHP installs a smaller PHP runtime without ICU (International Components for Unicode) to keep app size minimal. |
| 58 | + |
| 59 | +If your Laravel app uses features that rely on `intl` (such as number formatting, localized date handling, or advanced string collation), you’ll need ICU support enabled. |
| 60 | + |
| 61 | +To include ICU during installation, select it when running: `php artisan native:install`. |
| 62 | + |
| 63 | +This will install a version of PHP with full ICU support. Note that it increases the PHP binary size significantly (typically from ~16MB to ~44MB). |
| 64 | + |
| 65 | +**Important:** If you plan to use [Filament](https://filamentphp.com/) in your app, you must enable this option. Filament relies on the `intl` extension for formatting and localization features. |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
0 commit comments