Skip to content

Commit 4b4a2b2

Browse files
committed
Add NativePHP internal configuration
1 parent 05e6ccb commit 4b4a2b2

File tree

3 files changed

+44
-3
lines changed

3 files changed

+44
-3
lines changed

config/nativephp-internal.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,32 @@
11
<?php
22

33
return [
4+
/**
5+
* An internal flag to indicate if the app is running in the NativePHP
6+
* environment. This is used to determine if the app should use the
7+
* NativePHP database and storage paths.
8+
*/
49
'running' => env('NATIVEPHP_RUNNING', false),
510

11+
/**
12+
* The path to the NativePHP storage directory. This is used to store
13+
* uploaded files and other data.
14+
*/
615
'storage_path' => env('NATIVEPHP_STORAGE_PATH'),
716

17+
/**
18+
* The path to the NativePHP database directory. This is used to store
19+
* the SQLite database file.
20+
*/
821
'database_path' => env('NATIVEPHP_DATABASE_PATH'),
922

23+
/**
24+
* The secret key used to communicate with the NativePHP API.
25+
*/
1026
'secret' => env('NATIVEPHP_SECRET'),
27+
28+
/**
29+
* The URL to the NativePHP API.
30+
*/
31+
'api_url' => env('NATIVEPHP_API_URL', 'http://localhost:4000/api/'),
1132
];

config/nativephp.php

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,33 @@
88
*/
99
'version' => env('NATIVEPHP_APP_VERSION', '1.0.0'),
1010

11+
/**
12+
* The ID of your application. This should be a unique identifier
13+
* usually in the form of a reverse domain name.
14+
* For example: com.nativephp.app
15+
*/
1116
'app_id' => env('NATIVEPHP_APP_ID'),
1217

18+
/**
19+
* If your application allows deep linking, you can specify the scheme
20+
* to use here. This is the scheme that will be used to open your
21+
* application from within other applications.
22+
* For example: "nativephp"
23+
*
24+
* This would allow you to open your application using a URL like:
25+
* nativephp://some/path
26+
*/
1327
'deeplink_scheme' => env('NATIVEPHP_DEEPLINK_SCHEME'),
1428

29+
/**
30+
* The author of your application.
31+
*/
1532
'author' => env('NATIVEPHP_APP_AUTHOR'),
1633

17-
'api_url' => env('NATIVEPHP_API_URL', 'http://localhost:4000/api/'),
18-
34+
/**
35+
* The default service provider for your application. This provider
36+
* takes care of bootstrapping your application and configuring
37+
* any global hotkeys, menus, windows, etc.
38+
*/
1939
'provider' => \App\Providers\NativeAppServiceProvider::class,
2040
];

src/Client/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Client
1313
public function __construct()
1414
{
1515
$this->client = Http::asJson()
16-
->baseUrl(config('nativephp.api_url', ''))
16+
->baseUrl(config('nativephp-internal.api_url', ''))
1717
->timeout(60 * 60)
1818
->withHeaders([
1919
'X-NativePHP-Secret' => config('nativephp-internal.secret'),

0 commit comments

Comments
 (0)