Skip to content

Commit 7857bde

Browse files
author
ipranjal
committed
feat: middlewares
1 parent a156629 commit 7857bde

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

config/app.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,8 @@
2525

2626
],
2727

28+
'middlewares'=>[
29+
// Register custom middlewares here
30+
]
31+
2832
];

src/Controllers/Main.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
namespace App\Controllers;
44

5-
class Main{
5+
class Main
6+
{
67

7-
public function allIndex(){
8+
public function allIndex()
9+
{
810
return view('home');
911
}
10-
12+
1113
}

src/Middlewares/.gitkeep

Whitespace-only changes.

src/boot.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
// Register Directories
3030
app()->registerAutoRoute(__DIR__ . '/Controllers', 'App\Controllers');
3131

32+
app()->middleware(app()->config()->get('middlewares'));
33+
3234
app()->template()->registerDir(__DIR__ . '/views',__DIR__ . '/../storage/framework/cache',__DIR__ . '/../public/assets');
3335

3436
app()->storage()->setAdapter(new \Scrawler\Adapters\Storage\LocalAdapter(__DIR__ . '/../storage/app'));

0 commit comments

Comments
 (0)