Добавление кнопки логаута
This commit is contained in:
parent
72fb1190f4
commit
8b2c3d44fa
@ -6,5 +6,8 @@ namespace App\Http\Controllers;
|
|||||||
|
|
||||||
class DashboardController extends Controller
|
class DashboardController extends Controller
|
||||||
{
|
{
|
||||||
//
|
public function index()
|
||||||
|
{
|
||||||
|
return view('dashboard');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,5 +2,9 @@
|
|||||||
|
|
||||||
@section ('content')
|
@section ('content')
|
||||||
<h1>dashboard</h1>
|
<h1>dashboard</h1>
|
||||||
@dump(auth()->user())
|
|
||||||
|
<form method="POST" action="{{ route('logout')}}">
|
||||||
|
@csrf
|
||||||
|
<button type="submit">выйти</button>
|
||||||
|
</form>
|
||||||
@endsection
|
@endsection
|
||||||
@ -2,12 +2,13 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use App\Http\Controllers\DashboardController;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
Route::get('/', function () {
|
Route::get('/', function () {
|
||||||
return view('main');
|
return view('main');
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::get('dashboard', function () {
|
Route::middleware(['auth', 'verified'])->group(function () {
|
||||||
return view('dashboard');
|
Route::get('/dashboard', [DashboardController::class, 'index']);
|
||||||
})->middleware(['auth', 'verified']);
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user