Skip to content

Commit

Permalink
Add middleware to routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammadreza-73 committed Apr 20, 2023
1 parent 914ebcc commit 24ffc77
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@ public function index()
{
return view('home');
}

public function dashboard()
{
echo 'admin dashboard';
}
}
1 change: 1 addition & 0 deletions routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
use App\Core\Http\Route;

Route::get('/', ['HomeController', 'index'])->middleware('guest');
Route::get('/admin', ['HomeController', 'dashboard'])->middleware('auth');

0 comments on commit 24ffc77

Please sign in to comment.