@@ -35,21 +35,7 @@ build environment. This means that changes you make to your application code _wi
35
35
application until you restart it.
36
36
37
37
You can stop the ` native:serve ` command by pressing ` Ctrl-C ` on your keyboard in the terminal window it's running in.
38
-
39
- Alternatively, you can use hot reloading.
40
-
41
- ### App Icon
42
-
43
- The ` native:serve ` and ` native:build ` commands look for the following icon files when building your application:
44
-
45
- - ` public/icon.png ` - your main icon, used on the Desktop, Dock and app switcher.
46
- - ` public/IconTemplate.png ` - used in the Menu Bar on non-retina displays.
47
- - ` public/[email protected] ` - used in the Menu Bar on retina displays.
48
-
49
- If any of these files exist, they will be moved into the relevant location to be used as your application's icons.
50
- You simply need to follow the naming convention.
51
-
52
- Your main icon should be at least 512x512 pixels.
38
+ It will also terminate when you quit your application.
53
39
54
40
## Hot Reloading
55
41
@@ -73,24 +59,53 @@ Now changes you make to files in your source code will cause a hot reload in you
73
59
74
60
Which files trigger reloads will depend on your Vite configuration.
75
61
62
+ ## ` composer native:dev `
63
+
64
+ You may find the ` native:dev ` script convenient. By default, it is setup to run both ` native:serve ` and ` npm run dev `
65
+ concurrently in a single command:
66
+
67
+ ``` shell
68
+ composer native:dev
69
+ ```
70
+
71
+ You may modify this script to suit your needs. Simply edit the command in your ` composer.json ` scripts section.
72
+
76
73
## First run
77
74
78
75
When your application runs for the first time, a number of things occur.
79
76
80
77
NativePHP will:
81
78
82
- 1 . Create the ` appdata ` folder - where this is created depends which platform you're developing on. It is named
83
- according to your ` nativephp.app_id ` config value (which is based on the ` NATIVEPHP_APP_ID ` env variable) .
84
- 2 . Create a SQLite database
85
- 3 . Migrate the database
79
+ 1 . Create the ` appdata ` folder - where this is created depends which platform you're developing on. In development, it
80
+ is named according to your ` APP_NAME ` .
81
+ 2 . Create a ` nativephp.sqlite ` SQLite database in your ` database ` folder.
82
+ 3 . Migrate this database.
86
83
87
- This is identical to what will happen when a new user runs a production build of your app for the first time on their
88
- device .
84
+ The ` appdata ` structure is identical to that created by _ production _ builds of your app, but when running in
85
+ development, the database created there is _ not _ migrated .
89
86
90
- ** If you change your ` app_id ` , a new ` appdata ` folder may need to be created and all of these steps will need to run
91
- again. No previous files will be deleted.**
87
+ ** If you change your ` APP_NAME ` , a new ` appdata ` folder will be created. No previous files will be deleted.**
92
88
93
89
## Subsequent runs
94
90
95
- Every time your application boots, NativePHP checks that these files exist and creates them if they don't. It also tries
96
- to run your migrations. This is done with the ` --force ` flag so that it is fully automated even in production.
91
+ In development, your application will not run migrations of the ` nativephp.sqlite ` database for you. You must do this
92
+ manually:
93
+
94
+ ``` shell
95
+ php artisan native:migrate
96
+ ```
97
+
98
+ For more details, see the [ Databases] ( /docs/digging-deeper/databases ) section.
99
+
100
+ ## App Icon
101
+
102
+ The ` native:serve ` and ` native:build ` commands look for the following icon files when building your application:
103
+
104
+ - ` public/icon.png ` - your main icon, used on the Desktop, Dock and app switcher.
105
+ - ` public/IconTemplate.png ` - used in the Menu Bar on non-retina displays.
106
+ - ` public/[email protected] ` - used in the Menu Bar on retina displays.
107
+
108
+ If any of these files exist, they will be moved into the relevant location to be used as your application's icons.
109
+ You simply need to follow the naming convention.
110
+
111
+ Your main icon should be at least 512x512 pixels.
0 commit comments