Configure your application’s metadata in config/nativephp.php:
config/nativephp.php
return [ /** * The version of your app. * Increment this value every time you release a new version. */ 'version' => env('NATIVEPHP_APP_VERSION', '1.0.0'), /** * The ID of your application. This should be a unique identifier * usually in the form of a reverse domain name. */ 'app_id' => env('NATIVEPHP_APP_ID', 'com.nativephp.app'), /** * The author of your application. */ 'author' => env('NATIVEPHP_APP_AUTHOR'), /** * The copyright notice for your application. */ 'copyright' => env('NATIVEPHP_APP_COPYRIGHT'), /** * The description of your application. */ 'description' => env('NATIVEPHP_APP_DESCRIPTION', 'An awesome app built with NativePHP'), /** * The Website of your application. */ 'website' => env('NATIVEPHP_APP_WEBSITE', 'https://nativephp.com'),];
Store sensitive values in your .env file and reference them using the env() helper. These values are used by Electron Builder to generate platform-specific metadata.
Control which files and directories are excluded from your production build:
config/nativephp.php
return [ /** * A list of files and folders that should be removed from the * final app before it is bundled for production. * You may use glob / wildcard patterns here. */ 'cleanup_exclude_files' => [ 'build', 'temp', 'content', 'node_modules', '*/tests', '.git', '.github', 'storage/logs/*.log', ],];
*/tests - Excludes any tests directory at any level
*.log - Excludes all log files
storage/logs/* - Excludes all files in storage/logs
Be careful not to exclude files required for your application to run. Excluding critical directories like vendor/ or bootstrap/ will break your application.
You can also explicitly include files that might have been excluded:
config/nativephp.php
return [ /** * A list of files and folders that should be included in the * final app even if they match exclusion patterns. */ 'cleanup_include_files' => [ 'node_modules/specific-package/**', 'storage/app/required-file.json', ],];
Included files are copied after the main copy operation, so they can override exclusion rules.
Protect sensitive information by removing specific environment variables from production builds:
config/nativephp.php
return [ /** * A list of environment keys that should be removed from the * .env file when the application is bundled for production. * You may use wildcards to match multiple keys. */ 'cleanup_env_keys' => [ 'AWS_*', // All AWS credentials 'AZURE_*', // All Azure credentials 'GITHUB_*', // All GitHub tokens 'DO_SPACES_*', // DigitalOcean Spaces '*_SECRET', // Any key ending with _SECRET 'BIFROST_*', // Build system credentials 'NATIVEPHP_UPDATER_PATH', 'NATIVEPHP_APPLE_ID', 'NATIVEPHP_APPLE_ID_PASS', 'NATIVEPHP_APPLE_TEAM_ID', ],];
Modifying electron-builder.mjs requires understanding Electron Builder’s configuration options. Refer to the Electron Builder documentation for advanced customization.
Enable deep linking to allow other applications to open your app with custom URLs:
config/nativephp.php
return [ /** * If your application allows deep linking, you can specify the scheme * to use here. This is the scheme that will be used to open your * application from within other applications. */ 'deeplink_scheme' => env('NATIVEPHP_DEEPLINK_SCHEME', 'myapp'),];
With this configuration, URLs like myapp://some/path will open your application.