prepare controllers
This commit is contained in:
parent
15196c79de
commit
46d1d616f8
13
app/Http/Controllers/Dashboard/DashboardIndexController.php
Normal file
13
app/Http/Controllers/Dashboard/DashboardIndexController.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Dashboard;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
|
class DashboardIndexController extends Controller
|
||||||
|
{
|
||||||
|
public function create(): View
|
||||||
|
{
|
||||||
|
return view('dashboard.index');
|
||||||
|
}
|
||||||
|
}
|
13
app/Http/Controllers/Dashboard/DashboardUsersController.php
Normal file
13
app/Http/Controllers/Dashboard/DashboardUsersController.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Dashboard;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
|
class DashboardIndexController extends Controller
|
||||||
|
{
|
||||||
|
public function create(): View
|
||||||
|
{
|
||||||
|
return view('dashboard.users');
|
||||||
|
}
|
||||||
|
}
|
@ -3,14 +3,25 @@
|
|||||||
use App\Http\Controllers\ProfileController;
|
use App\Http\Controllers\ProfileController;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
|
use App\Models\User;
|
||||||
|
|
||||||
|
|
||||||
Route::get('/', function () {
|
Route::get('/', function () {
|
||||||
return view('home');
|
return view('home');
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::get('/dashboard', function () {
|
Route::get('/dashboard', function () {
|
||||||
return view('dashboard');
|
$users = \App\Models\User::all();
|
||||||
|
return view('dashboard.index', compact('users'));
|
||||||
})->middleware(['auth', 'verified'])->name('dashboard');
|
})->middleware(['auth', 'verified'])->name('dashboard');
|
||||||
|
|
||||||
|
// Subroute for users under /dashboard/users
|
||||||
|
Route::get('/dashboard/users', function () {
|
||||||
|
$users = \App\Models\User::all();
|
||||||
|
return view('dashboard.users', compact('users'));
|
||||||
|
})->name('dashboard.users');
|
||||||
|
|
||||||
|
|
||||||
Route::middleware('auth')->group(function () {
|
Route::middleware('auth')->group(function () {
|
||||||
Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
|
Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
|
||||||
Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
|
Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
|
||||||
|
Loading…
Reference in New Issue
Block a user