File tree Expand file tree Collapse file tree 4 files changed +46
-1
lines changed Expand file tree Collapse file tree 4 files changed +46
-1
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,14 @@ class Kernel extends HttpKernel
3131 \App \Http \Middleware \VerifyCsrfToken::class,
3232 \Illuminate \Routing \Middleware \SubstituteBindings::class,
3333 ],
34-
34+ 'admin ' => [
35+ \App \Http \Middleware \EncryptCookies::class,
36+ \Illuminate \Cookie \Middleware \AddQueuedCookiesToResponse::class,
37+ \Illuminate \Session \Middleware \StartSession::class,
38+ \Illuminate \View \Middleware \ShareErrorsFromSession::class,
39+ \App \Http \Middleware \VerifyCsrfToken::class,
40+ \Illuminate \Routing \Middleware \SubstituteBindings::class,
41+ ],
3542 'api ' => [
3643 'throttle:60,1 ' ,
3744 'bindings ' ,
Original file line number Diff line number Diff line change @@ -39,9 +39,29 @@ public function map()
3939
4040 $ this ->mapWebRoutes ();
4141
42+ $ this ->mapAdminRoutes ();
4243 //
4344 }
4445
46+
47+ /**
48+ * Define the "web" routes for the application.
49+ *
50+ * These routes all receive session state, CSRF protection, etc.
51+ *
52+ * @return void
53+ */
54+ protected function mapAdminRoutes ()
55+ {
56+ Route::group ([
57+ 'prefix ' =>'/admin ' ,
58+ 'middleware ' => 'admin ' ,
59+ 'namespace ' => 'App\Http\Controllers\Admin ' ,
60+ ], function ($ router ) {
61+ require base_path ('routes/admin.php ' );
62+ });
63+ }
64+
4565 /**
4666 * Define the "web" routes for the application.
4767 *
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /*
4+ |--------------------------------------------------------------------------
5+ | Web Routes
6+ |--------------------------------------------------------------------------
7+ |
8+ | This file is where you may define all of the routes that are handled
9+ | by your application. Just tell Laravel the URIs it should respond
10+ | to using a Closure or controller method. Build something great!
11+ |
12+ */
13+
14+ Route::get ('/ ' , function () {
15+ return view ('welcome ' );
16+ });
Original file line number Diff line number Diff line change 1+ *
2+ ! .gitignore
You can’t perform that action at this time.
0 commit comments