Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
'name' => env('APP_NAME', 'My PWA App'),
'short_name' => 'PWA',
'start_url' => '/',
'scope' => '.',
'background_color' => '#ffffff',
'theme_color' => '#000000',
'display' => 'standalone',
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Configure your app name, description, icons and splashes in `config/laravelpwa.
'name' => env('APP_NAME', 'My PWA App'),
'short_name' => 'PWA',
'start_url' => '/',
'scope' => '.',
'background_color' => '#ffffff',
'theme_color' => '#000000',
'display' => 'standalone',
Expand Down
1 change: 1 addition & 0 deletions Services/ManifestService.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public function generate()
'name' => config('laravelpwa.manifest.name'),
'short_name' => config('laravelpwa.manifest.short_name'),
'start_url' => asset(config('laravelpwa.manifest.start_url')),
'scope' => asset(config('laravelpwa.manifest.scope')),
'display' => config('laravelpwa.manifest.display'),
'theme_color' => config('laravelpwa.manifest.theme_color'),
'background_color' => config('laravelpwa.manifest.background_color'),
Expand Down
4 changes: 2 additions & 2 deletions resources/views/meta.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
// Initialize the service worker
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/serviceworker.js', {
scope: '.'
scope: '{{ $config['scope'] }}'
}).then(function (registration) {
// Registration was successful
console.log('Laravel PWA: ServiceWorker registration successful with scope: ', registration.scope);
Expand All @@ -43,4 +43,4 @@
console.log('Laravel PWA: ServiceWorker registration failed: ', err);
});
}
</script>
</script>