File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 22
33return [
44
5+ // Include assets you want to link on every page load here.
56 'default_links ' => [
6-
77 'styles ' => [
88
99 ],
1515 'images ' => [
1616
1717 ],
18-
1918 ],
2019
2120];
Original file line number Diff line number Diff line change @@ -30,4 +30,22 @@ public function register()
3030 return $ this ->app ->make (HttpPush::class);
3131 });
3232 }
33+
34+ /**
35+ * Load the default links from the config.
36+ */
37+ protected function registerDefaultLinks ()
38+ {
39+ $ this ->mergeConfigFrom (__DIR__ . '/../config/server-push.php ' , 'server-push ' );
40+
41+ $ instance = app ('server-push ' );
42+
43+ foreach (config ('server-push.default_links ' , []) as $ type => $ paths ) {
44+ $ type = rtrim ($ type , 's ' );
45+ foreach ($ paths as $ path ) {
46+ $ instance ->queueResource ($ path , $ type );
47+ }
48+ }
49+ }
50+
3351}
You can’t perform that action at this time.
0 commit comments