@@ -108,6 +108,36 @@ You can update your PWA manifest file by running:
108
108
php artisan erag:update-manifest
109
109
```
110
110
111
+ ## Usage 🛠️
112
+
113
+ To integrate PWA functionality into your layouts, use the provided Blade directives.
114
+
115
+ ### 1. ** Add Meta Tags**
116
+
117
+ Place the ` @PwaHead ` directive inside the ` <head> ` tag of your main layout file:
118
+
119
+ ``` blade
120
+ <!DOCTYPE html>
121
+ <html lang="en">
122
+ <head>
123
+ @PwaHead <!-- Add this directive to include the PWA meta tags -->
124
+ <title>Your App Title</title>
125
+ </head>
126
+ <body>
127
+ ```
128
+
129
+ ### 2. ** Register Service Worker**
130
+
131
+ Just before the closing ` </body> ` tag in your main layout file, add:
132
+
133
+ ``` blade
134
+ @RegisterServiceWorkerScript <!-- This registers the service worker -->
135
+ </body>
136
+ </html>
137
+ ```
138
+ These directives will automatically generate the necessary tags and JavaScript for the PWA.
139
+
140
+
111
141
## Facade Usage 🎯
112
142
113
143
You can easily update the manifest dynamically at runtime using the provided ` PWA ` Facade.
@@ -139,34 +169,6 @@ PWA::update([
139
169
140
170
This command updates the ` manifest.json ` file located in the public directory of your Laravel project.
141
171
142
- ## Usage 🛠️
143
-
144
- To integrate PWA functionality into your layouts, use the provided Blade directives.
145
-
146
- ### 1. ** Add Meta Tags**
147
-
148
- Place the ` @PwaHead ` directive inside the ` <head> ` tag of your main layout file:
149
-
150
- ``` blade
151
- <!DOCTYPE html>
152
- <html lang="en">
153
- <head>
154
- @PwaHead <!-- Add this directive to include the PWA meta tags -->
155
- <title>Your App Title</title>
156
- </head>
157
- <body>
158
- ```
159
-
160
- ### 2. ** Register Service Worker**
161
-
162
- Just before the closing ` </body> ` tag in your main layout file, add:
163
-
164
- ``` blade
165
- @RegisterServiceWorkerScript <!-- This registers the service worker -->
166
- </body>
167
- </html>
168
- ```
169
- These directives will automatically generate the necessary tags and JavaScript for the PWA.
170
172
171
173
172
174
## Uploading a Logo via PWA 🌟
0 commit comments