@@ -110,9 +110,53 @@ Just before the closing `</body>` tag in your main layout file, add:
110110</body>
111111</html>
112112```
113-
114113These directives will automatically generate the necessary tags and JavaScript for the PWA.
115114
115+
116+ ## Uploading a Logo via PWA 🌟
117+ To update the PWA logo dynamically, follow these steps:
118+ Your Laravel PWA is now configured to update the logo dynamically! 🚀
119+
120+ #### 1. ** Create a Controller Method**
121+
122+ ** Input Key Name:** ` logo `
123+ Make sure the image is in PNG format, at least 512x512 pixels, and does not exceed 1024 KB in size.
124+
125+ ``` html
126+ <input type =" file" name =" logo" accept =" .png" >
127+ ```
128+
129+ ``` php
130+ namespace App\Http\Controllers;
131+
132+ use EragLaravelPwa\Core\PWA;
133+ use Illuminate\Http\Request;
134+ use Illuminate\Routing\Controller;
135+
136+ class SettingsController extends Controller
137+ {
138+ public function uploadLogo(Request $request)
139+ {
140+ $response = PWA::processLogo($request);
141+
142+ if ($response['status']) {
143+ return redirect()->back()->with('success', $response['message']);
144+ }
145+
146+ return redirect()->back()->withErrors($response['errors'] ?? ['Something went wrong.']);
147+ }
148+ }
149+ ```
150+
151+ ``` php
152+ array:2 [▼ // EragLaravelPwa/src/Core/PWA.php:19
153+ "_token" => "iKbZh21VsYZMpNd9TN12Ul5SoysQzkMXlQkhB5Ub"
154+ "logo" => Illuminate\Http\UploadedFile{#1426 ▶}]
155+ ```
156+
157+ Once uploaded, the new logo will be available at ` http://yourdomain.com/logo.png ` .
158+
159+
116160## Screenshots 📸
117161
118162<img width =" 1470 " alt =" Screenshot 2024-09-19 at 10 11 01 PM " src =" https://github.com/user-attachments/assets/27c08862-0557-4fbd-bd8f-90b9d05f67b3 " >
0 commit comments