After 'php artisan make:controller Admin/DashboardController', I included code below (Controllers/Admin/DashboardController).
DashboardController.php
namespace App\Http\Controllers\Admin;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class DashboardController extends Controller
{
//Dashboard
public function dashboard(){
return view('admin.dashboard');
}
}
In web.php:
Route::get(['prefix'=>'admin', 'namespace'=>'Admin', 'middleware'=>
['auth']], function(){
Route::get('/', 'DashboardController@dashboard')->name(admin.index);
});
In views/admin/dashboard.blade.php
@extends('layouts.app)
@section('content')
<h1>Admin test</h1>
@endsection
Aucun commentaire:
Enregistrer un commentaire