Добавление кнопки логаута

This commit is contained in:
Toy Rik 2026-02-11 14:29:22 +03:00
parent 72fb1190f4
commit 8b2c3d44fa
3 changed files with 13 additions and 5 deletions

View File

@ -6,5 +6,8 @@ namespace App\Http\Controllers;
class DashboardController extends Controller
{
//
public function index()
{
return view('dashboard');
}
}

View File

@ -2,5 +2,9 @@
@section ('content')
<h1>dashboard</h1>
@dump(auth()->user())
<form method="POST" action="{{ route('logout')}}">
@csrf
<button type="submit">выйти</button>
</form>
@endsection

View File

@ -2,12 +2,13 @@
declare(strict_types=1);
use App\Http\Controllers\DashboardController;
use Illuminate\Support\Facades\Route;
Route::get('/', function () {
return view('main');
});
Route::get('dashboard', function () {
return view('dashboard');
})->middleware(['auth', 'verified']);
Route::middleware(['auth', 'verified'])->group(function () {
Route::get('/dashboard', [DashboardController::class, 'index']);
});