<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\LoginController;
use App\Http\Controllers\AdminController;
use App\Http\Controllers\UserController;
use App\Http\Controllers\MakananController;
use App\Http\Controllers\Auth\RegisterController;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/

// Route::get('/', function () {
//     return view('welcome');
// });



Route::get('/admindash',[AdminController::class,'admindash'])->name('admindash');





Route::get('/datauser', [AdminController::class, 'datauser'])->name('datauser');
Route::get('/edituser/{user}/edituser', [AdminController::class, 'edituser'])->name('edituser');
Route::put('/datauser/{user}', [AdminController::class, 'updateuser'])->name('updateuser');
Route::delete('/datauser/{user}', [AdminController::class, 'deleteuser'])->name('deleteuser');
Route::get('/tambahuser', [AdminController::class, 'tambahuser'])->name('tambahuser');
Route::post('/datauser/storeuser', [AdminController::class, 'storeuser'])->name('storeuser');



Route::get('/role',[AdminController::class,'role'])->name('role');
Route::get('/editrole/{role}/editrole', [AdminController::class, 'editrole'])->name('editrole');
Route::put('/role/{role}', [AdminController::class, 'updaterole'])->name('updaterole');
Route::delete('/role/{role}', [AdminController::class, 'deleterole'])->name('deleterole');
Route::get('/tambahrole', [AdminController::class, 'tambahrole'])->name('tambahrole');
Route::post('/role/storerole', [AdminController::class, 'storerole'])->name('storerole');



Route::get('/kategori', [MakananController::class, 'kategori'])->name('kategori');
Route::get('/editkategori/{kategori}/editkategori', [MakananController::class, 'editkategori'])->name('editkategori');
Route::put('/kategori/{kategori}', [MakananController::class, 'updatekategori'])->name('updatekategori');
Route::delete('/kategori/{kategori}', [MakananController::class, 'deletekategori'])->name('deletekategori');
Route::get('/tambahkategori', [MakananController::class, 'tambahkategori'])->name('tambahkategori');
Route::post('/kategori/storekategori', [MakananController::class, 'storekategori'])->name('storekategori');




Route::get('/makanan',[MakananController::class,'makanan'])->name('makanan');
Route::get('/editmakanan/{makanan}/editmakanan', [MakananController::class, 'editmakanan'])->name('editmakanan');
Route::put('/makanan/{makanan}', [MakananController::class, 'updatemakanan'])->name('updatemakanan');
Route::delete('/makanan/{makanan}', [MakananController::class, 'deletemakanan'])->name('deletemakanan');
Route::get('/tambahmakanan', [MakananController::class, 'tambahmakanan'])->name('tambahmakanan');
Route::post('/makanan/storemakanan', [MakananController::class, 'storemakanan'])->name('makanan.storemakanan');





Route::get('/kriteria',[AdminController::class,'kriteria'])->name('kriteria');
Route::get('/editkriteria/{kriteria}/editkriteria', [AdminController::class, 'editkriteria'])->name('editkriteria');
Route::put('/kriteria/{kriteria}', [AdminController::class, 'updatekriteria'])->name('updatekriteria');
Route::delete('/kriteria/{kriteria}', [AdminController::class, 'deletekriteria'])->name('deletekriteria');
Route::get('/tambahkriteria', [AdminController::class, 'tambahkriteria'])->name('tambahkriteria');
Route::post('/kriteria/storekriteria', [AdminController::class, 'storekriteria'])->name('storekriteria');

Route::get('/alternatif',[AdminController::class,'alternatif'])->name('alternatif');
Route::get('/editalternatif/{alternatif}/editalternatif', [AdminController::class, 'editalternatif'])->name('editalternatif');
Route::put('/alternatif/{alternatif}', [AdminController::class, 'updatealternatif'])->name('updatealternatif');
Route::delete('/alternatif/{alternatif}', [AdminController::class, 'deletealternatif'])->name('deletealternatif');
Route::get('/tambahalternatif', [AdminController::class, 'tambahalternatif'])->name('tambahalternatif');
Route::post('/alternatif/storealternatif', [AdminController::class, 'storealternatif'])->name('storealternatif');



Route::get('/',[UserController::class,'userdash'])->name('userdash');
Route::get('/about',[UserController::class,'about'])->name('about');
Route::get('/service',[UserController::class,'service'])->name('service');
Route::get('/feature',[UserController::class,'feature'])->name('feature');


Route::get('/login',[LoginController::class,'login'])->name('login');

Route::get('/register', [RegisterController::class, 'showForm'])->name('register');
Route::post('/register', [RegisterController::class, 'register'])->name('register.submit');

