Menus affichés sur '/menus'

This commit is contained in:
Olivier DOSSMANN 2021-04-27 19:33:12 +02:00
parent e82a9eedc7
commit 62747bea5d
3 changed files with 8 additions and 1 deletions

View File

@ -14,7 +14,8 @@ class MenuController extends Controller
*/ */
public function index() public function index()
{ {
// return view('menus')
->with('menus', Menu::get());
} }
/** /**

View File

@ -0,0 +1,4 @@
@foreach($menus as $menu)
<li>{{ $menu->title }}</li>
@endforeach

View File

@ -16,3 +16,5 @@ use Illuminate\Support\Facades\Route;
Route::get('/', function () { Route::get('/', function () {
return view('welcome'); return view('welcome');
}); });
Route::resource('menus', \App\Http\Controllers\MenuController::class);