<?php

use App\Livewire\Settings\Appearance;
use App\Livewire\Settings\Password;
use App\Livewire\Settings\Profile;
use App\Livewire\FoodOrder;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\TypeItemsController;
use App\Http\Controllers\ItemsController;
use App\Http\Controllers\MejaController;
use App\Http\Controllers\BundlesController;

// Route::get('/', function () {
//     return view('welcome');
// })->name('home');

Route::get('/', FoodOrder::class)->name('food.order');

// Route::get('/menu/makanan', function() {
//     return app(FoodOrder::class, ['type' => 'makanan']);
// })->name('menu.makanan');

// Route::get('/menu/minuman', function() {
//     return app(FoodOrder::class, ['type' => 'minuman']);
// })->name('menu.minuman');

// Route::get('/menu/snack', function() {
//     return app(FoodOrder::class, ['type' => 'snack']);
// })->name('menu.snack');

// Route::get('/menu/dessert', function() {
//     return app(FoodOrder::class, ['type' => 'dessert']);
// })->name('menu.dessert');



Route::get('/refresh-csrf', function () {
    return response()->json(['csrf_token' => csrf_token()]);
});



Route::view('dashboard', 'dashboard')
    ->middleware(['auth', 'verified'])
    ->name('dashboard');

Route::middleware(['auth'])->group(function () {
    Route::redirect('settings', 'settings/profile');
    Route::redirect('admin', 'dashboard', 301);
    Route::redirect('home', 'dashboard', 301);

    Route::resource('typeitems',TypeItemsController::class);
    Route::resource('items',ItemsController::class);
    Route::resource('tables',MejaController::class);
    Route::resource('bundles',BundlesController::class);

    Route::get('settings/profile', Profile::class)->name('settings.profile');
    Route::get('settings/password', Password::class)->name('settings.password');
    Route::get('settings/appearance', Appearance::class)->name('settings.appearance');
});


require __DIR__.'/auth.php';
