Assets
On this page
#Compiling CSS and JavaScript
If you are using React, Vue or another JavaScript library, or Tailwind CSS, tools that requires your frontend to be built by build tooling like Vite, you will need to run your build process before compiling the native application.
For example, if you're using Vite with NPM to build a React application that is using Tailwind, to ensure that your
latest styles and JavaScript are included, always run npm run build before running php artisan native:run.
#Other files
NativePHP will include all files from the root of your Laravel application. So you can store any files that you wish to make available to your application wherever makes the most sense for you.
#Public files
If your application receives files from the user — either generated by your application or imported from elsewhere, such as their photo gallery — you may wish to render these to the web view so they can be played or displayed as part of your app.
For this to work, they must be in the public directory. But you may also wish to persist these files across app
updates. For this reason, they are stored outside of the public directory in a persistent storage location and this
folder is symlinked to public/storage.
You can then access these files using the mobile_public disk:
Storage::disk('mobile_public')->url('user_content.jpg');