NativePHP
Windows support is here! 🔥 Read the full announcement →
Configuration

NativePHP is currently in alpha development

Let's get to beta!

#
Configuration

The native:install command publishes a configuration file to config/nativephp.php. This file contains all the configuration options for NativePHP.

#
Default Configuration File

Copied!
1return [
2 /**
3 * The version of your app.
4 * It is used to determine if the app needs to be updated.
5 * Increment this value every time you release a new version of your app.
6 */
7 'version' => env('NATIVEPHP_APP_VERSION', '1.0.0'),
8 
9 /**
10 * The ID of your application. This should be a unique identifier
11 * usually in the form of a reverse domain name.
12 * For example: com.nativephp.app
13 */
14 'app_id' => env('NATIVEPHP_APP_ID'),
15 
16 /**
17 * If your application allows deep linking, you can specify the scheme
18 * to use here. This is the scheme that will be used to open your
19 * application from within other applications.
20 * For example: "nativephp"
21 *
22 * This would allow you to open your application using a URL like:
23 * nativephp://some/path
24 */
25 'deeplink_scheme' => env('NATIVEPHP_DEEPLINK_SCHEME'),
26 
27 /**
28 * The author of your application.
29 */
30 'author' => env('NATIVEPHP_APP_AUTHOR'),
31 
32 /**
33 * The default service provider for your application. This provider
34 * takes care of bootstrapping your application and configuring
35 * any global hotkeys, menus, windows, etc.
36 */
37 'provider' => \App\Providers\NativeAppServiceProvider::class,
38 
39 /**
40 * A list of environment keys that should be removed from the
41 * .env file when the application is bundled for production.
42 * You may use wildcards to match multiple keys.
43 */
44 'cleanup_env_keys' => [
45 'AWS_*',
46 'GITHUB_*',
47 'DO_SPACES_*',
48 '*_SECRET',
49 'NATIVEPHP_UPDATER_PATH',
50 'NATIVEPHP_APPLE_ID',
51 'NATIVEPHP_APPLE_ID_PASS',
52 'NATIVEPHP_APPLE_TEAM_ID',
53 ],
54 
55 /**
56 * A list of files and folders that should be removed from the
57 * final app before it is bundled for production.
58 * You may use glob / wildcard patterns here.
59 */
60 'cleanup_exclude_files' => [
61 'content',
62 'storage/app/framework/{sessions,testing,cache}',
63 'storage/logs/laravel.log',
64 ],
65 
66 /**
67 * The NativePHP updater configuration.
68 */
69 'updater' => [
70 /**
71 * Whether or not the updater is enabled. Please note that the
72 * updater will only work when your application is bundled
73 * for production.
74 */
75 'enabled' => env('NATIVEPHP_UPDATER_ENABLED', true),
76 
77 /**
78 * The updater provider to use.
79 * Supported: "github", "s3", "spaces"
80 */
81 'default' => env('NATIVEPHP_UPDATER_PROVIDER', 'spaces'),
82 
83 'providers' => [
84 'github' => [
85 'driver' => 'github',
86 'repo' => env('GITHUB_REPO'),
87 'owner' => env('GITHUB_OWNER'),
88 'token' => env('GITHUB_TOKEN'),
89 'vPrefixedTagName' => env('GITHUB_V_PREFIXED_TAG_NAME', true),
90 'private' => env('GITHUB_PRIVATE', false),
91 'channel' => env('GITHUB_CHANNEL', 'latest'),
92 'releaseType' => env('GITHUB_RELEASE_TYPE', 'draft'),
93 ],
94 
95 's3' => [
96 'driver' => 's3',
97 'key' => env('AWS_ACCESS_KEY_ID'),
98 'secret' => env('AWS_SECRET_ACCESS_KEY'),
99 'region' => env('AWS_DEFAULT_REGION'),
100 'bucket' => env('AWS_BUCKET'),
101 'endpoint' => env('AWS_ENDPOINT'),
102 'path' => env('NATIVEPHP_UPDATER_PATH', null),
103 ],
104 
105 'spaces' => [
106 'driver' => 'spaces',
107 'key' => env('DO_SPACES_KEY_ID'),
108 'secret' => env('DO_SPACES_SECRET_ACCESS_KEY'),
109 'name' => env('DO_SPACES_NAME'),
110 'region' => env('DO_SPACES_REGION'),
111 'path' => env('NATIVEPHP_UPDATER_PATH', null),
112 ],
113 ],
114 ],
115];

#
Customize php.ini

When your NativePHP application starts, you may want to customize php.ini directives that will be used for your application.

You may configure these directives via the phpIni() method on your NativeAppServiceProvider. This method should return an array of php.ini directives to be set.

Copied!
1namespace App\Providers;
2 
3use Native\Laravel\Facades\Window;
4use Native\Laravel\Contracts\ProvidesPhpIni;
5 
6class NativeAppServiceProvider implements ProvidesPhpIni
7{
8 /**
9 * Executed once the native application has been booted.
10 * Use this method to open windows, register global shortcuts, etc.
11 */
12 public function boot(): void
13 {
14 Window::open();
15 }
16 
17 
18 public function phpIni(): array
19 {
20 return [
21 'memory_limit' => '512M',
22 'display_errors' => '1',
23 'error_reporting' => 'E_ALL',
24 'max_execution_time' => '0',
25 'max_input_time' => '0',
26 ];
27 }
28}