You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add new updater docs, config options, and app relaunch feature (#112)
Expanded documentation for the auto-updater, including events, manual updates, and usage instructions. Introduced new configuration fields for app description and website. Added support for relaunching the application with the `App::relaunch()` method.
- Amazon S3 - See [this video](https://www.youtube.com/watch?v=FLIp6BLtwjk&ab_channel=CloudCasts) by Chris Fidao or
78
-
this [Step 2](https://www.twilio.com/docs/video/tutorials/storing-aws-s3#step-2) of this article by Twilio
82
+
- Amazon S3 - See [this video](https://www.youtube.com/watch?v=FLIp6BLtwjk&ab_channel=CloudCasts) by Chris Fidao or
83
+
this [Step 2](https://www.twilio.com/docs/video/tutorials/storing-aws-s3#step-2) of this article by Twilio
79
84
80
-
If you got the error message "The bucket does not allow ACLs" you can follow this guide from [Learn AWS](https://www.learnaws.org/2023/08/26/aws-s3-bucket-does-not-allow-acls)
81
-
on how to setup your bucket correctly.
85
+
If you got the error message "The bucket does not allow ACLs" you can follow this guide
86
+
from [Learn AWS](https://www.learnaws.org/2023/08/26/aws-s3-bucket-does-not-allow-acls)
87
+
on how to setup your bucket correctly.
82
88
83
89
## Disabling the updater
84
90
@@ -88,3 +94,79 @@ If you don't want your application to check for updates, you can disable the upd
88
94
```dotenv
89
95
NATIVEPHP_UPDATER_ENABLED=false
90
96
```
97
+
98
+
## Manually checking for updates
99
+
100
+
You can manually check for updates by calling the `checkForUpdates` method on the `AutoUpdater` facade:
101
+
102
+
```php
103
+
use Native\Laravel\Facades\AutoUpdater;
104
+
105
+
AutoUpdater::checkForUpdates();
106
+
```
107
+
108
+
**Note:** If an update is available, it will be downloaded automatically. Calling `AutoUpdater::checkForUpdates() twice
109
+
will download the update two times.
110
+
111
+
## Quit and Install
112
+
113
+
You can quit the application and install the update by calling the `quitAndInstall` method on the `AutoUpdater` facade:
114
+
115
+
```php
116
+
use Native\Laravel\Facades\AutoUpdater;
117
+
118
+
AutoUpdater::quitAndInstall();
119
+
```
120
+
121
+
This will quit the application and install the update. The application will then relaunch automatically.
122
+
123
+
**Note:** Calling this method is optional — any successfully downloaded update will be applied the next time the
124
+
application starts.
125
+
126
+
## Events
127
+
128
+
### `CheckingForUpdate`
129
+
130
+
The `Native\Laravel\Events\AutoUpdater\CheckingForUpdate` event is dispatched when checking for an available update has
131
+
started.
132
+
133
+
### `UpdateAvailable`
134
+
135
+
The `Native\Laravel\Events\AutoUpdater\UpdateAvailable` event is dispatched when there is an available update. The
136
+
update is downloaded automatically.
137
+
138
+
### `UpdateNotAvailable`
139
+
140
+
The `Native\Laravel\Events\AutoUpdater\UpdateNotAvailable` event is dispatched when there is no available update.
141
+
142
+
### `DownloadProgress`
143
+
144
+
The `Native\Laravel\Events\AutoUpdater\DownloadProgress` event is dispatched when the update is being downloaded.
145
+
146
+
The event contains the following properties:
147
+
148
+
-`total`: The total size of the update in bytes.
149
+
-`delta`: The size of the update that has been downloaded since the last event.
150
+
-`transferred`: The total size of the update that has been downloaded.
151
+
-`percent`: The percentage of the update that has been downloaded (0-100).
152
+
-`bytesPerSecond`: The download speed in bytes per second.
153
+
154
+
### `UpdateDownloaded`
155
+
156
+
The `Native\Laravel\Events\AutoUpdater\UpdateDownloaded` event is dispatched when the update has been downloaded.
157
+
158
+
The event contains the following properties:
159
+
160
+
-`version`: The version of the update.
161
+
-`downloadedFile`: The local path to the downloaded update file.
162
+
-`releaseDate`: The release date of the update in ISO 8601 format.
163
+
-`releaseNotes`: The release notes of the update.
164
+
-`releaseName`: The name of the update.
165
+
166
+
### `Error`
167
+
168
+
The `Native\Laravel\Events\AutoUpdater\Error` event is dispatched when there is an error while updating.
0 commit comments