Initial api service;

Clean code;
This commit is contained in:
c.girardi
2024-02-21 17:58:41 +01:00
parent cd9c380b58
commit f56a6e820c
7 changed files with 139 additions and 30 deletions

View File

@@ -26,36 +26,17 @@ Route::get('/', function () {
return redirect('words');
});
Route::prefix('test')->group(function () {
Route::get('/{name?}', function (?string $name = null) {
return $name ?? 'niente';
})->whereAlpha('name');
Route::get('/{number}', function (int $number = null) {
return $number;
})->whereNumber('number');
});
Route::get('/pippo', function (Request $request) {
return response()->json([
'name' => 'Abigail',
'state' => 'CA',
]);
});
Route::get('/dashboard', function () {
return view('dashboard');
})->middleware(['auth', 'verified'])->name('dashboard');
Route::middleware('auth')->group(function () {
Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy');
});
//Route::get('/dashboard', function () {
// return view('dashboard');
//})->middleware(['auth', 'verified'])->name('dashboard');
//
//Route::middleware('auth')->group(function () {
// Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
// Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
// Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy');
//});
Route::prefix('words')->group(function () {
Route::get('/', [WordsController::class, 'index'])->name('words.index');