File tree Expand file tree Collapse file tree 7 files changed +36
-5
lines changed
Expand file tree Collapse file tree 7 files changed +36
-5
lines changed Original file line number Diff line number Diff line change 11<p align =" center " >
2- <img src="https://github.com/beyondscript/Laravel-Query-Builder-with-Vue-JS/blob/main/public/images/icons/favicon.%3Cspan%20class="x x-first x-last">webp " width="60" height="60" margin-left="auto" margin-right="auto" alt="Logo">
2+ <img src="https://github.com/beyondscript/Laravel-Query-Builder-with-Vue-JS/blob/main/public/images/icons/favicon.%3Cspan%20class="x x-first x-last">png " width="60" height="60" margin-left="auto" margin-right="auto" alt="Logo">
33 <br>
44 Laravel Query Builder with Vue JS
55</p >
Original file line number Diff line number Diff line change @@ -63,5 +63,6 @@ class Kernel extends HttpKernel
6363 'signed ' => \App \Http \Middleware \ValidateSignature::class,
6464 'throttle ' => \Illuminate \Routing \Middleware \ThrottleRequests::class,
6565 'verified ' => \Illuminate \Auth \Middleware \EnsureEmailIsVerified::class,
66+ 'www ' => \App \Http \Middleware \RedirectNonWww::class,
6667 ];
6768}
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace App \Http \Middleware ;
4+
5+ use Closure ;
6+ use Illuminate \Http \Request ;
7+
8+ class RedirectNonWww
9+ {
10+ /**
11+ * Handle an incoming request.
12+ *
13+ * @param \Illuminate\Http\Request $request
14+ * @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
15+ * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
16+ */
17+ public function handle (Request $ request , Closure $ next )
18+ {
19+ if (env ('APP_ENV ' ) != 'local ' ){
20+ if (!$ request ->wantsJson () && !preg_match ('/^www\./ ' , $ request ->host ())) {
21+ $ wwwUrl = $ request ->getScheme () . '://www. ' . $ request ->getHost () . $ request ->getRequestUri ();
22+ return redirect ()->to ($ wwwUrl , 301 );
23+ }
24+ }
25+
26+ return $ next ($ request );
27+ }
28+ }
Original file line number Diff line number Diff line change 66 <meta name =" robots" content =" noindex, nofollow" >
77 <meta property =" og:image" content =" {{ asset (' images/icons/facebookimage.png' ) } }" >
88
9- <link rel =" icon" type =" image/webp " href =" {{ asset (' images/icons/favicon.webp ' )} }" >
9+ <link rel =" icon" type =" image/png " href =" {{ asset (' images/icons/favicon.png ' )} }" >
1010
1111 <link rel =" stylesheet" href =" https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/css/bootstrap.min.css" >
1212 <link rel =" stylesheet" href =" https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" >
Original file line number Diff line number Diff line change 1313|
1414*/
1515
16- Route::get ('/{any} ' , function () {
17- return view ('welcome ' );
18- })->where ('any ' ,'.* ' );
16+ Route::middleware (['www ' ])->group (function () {
17+ Route::get ('/{any} ' , function () {
18+ return view ('welcome ' );
19+ })->where ('any ' ,'.* ' );
20+ });
You can’t perform that action at this time.
0 commit comments