NativePHP
⚠️ NativePHP is currently an alpha release and is not ready for production applications yet.
Configuration

#
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

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 * The NativePHP updater configuration.
41 */
42 'updater' => [
43 /**
44 * Whether or not the updater is enabled. Please note that the
45 * updater will only work when your application is bundled
46 * for production.
47 */
48 'enabled' => env('NATIVEPHP_UPDATER_ENABLED', true),
49 
50 /**
51 * The updater provider to use.
52 * Supported: "s3", "spaces"
53 */
54 'default' => env('NATIVEPHP_UPDATER_PROVIDER', 'spaces'),
55 
56 'providers' => [
57 's3' => [
58 'driver' => 's3',
59 'key' => env('AWS_ACCESS_KEY_ID'),
60 'secret' => env('AWS_SECRET_ACCESS_KEY'),
61 'region' => env('AWS_DEFAULT_REGION'),
62 'bucket' => env('AWS_BUCKET'),
63 'endpoint' => env('AWS_ENDPOINT'),
64 'path' => env('NATIVEPHP_UPDATER_PATH', null),
65 ],
66 
67 'spaces' => [
68 'driver' => 'spaces',
69 'key' => env('DO_SPACES_KEY_ID'),
70 'secret' => env('DO_SPACES_SECRET_ACCESS_KEY'),
71 'name' => env('DO_SPACES_NAME'),
72 'region' => env('DO_SPACES_REGION'),
73 'path' => env('NATIVEPHP_UPDATER_PATH', null),
74 ],
75 ],
76 ],
77];

#
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.

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}