<?php

use App\Http\Controllers\ReportsController;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\pages\HomePage;
use App\Http\Controllers\pages\Page2;
use App\Http\Controllers\pages\MiscError;
use App\Http\Controllers\authentications\LoginBasic;
use App\Http\Controllers\authentications\RegisterBasic;


/*
|--------------------------------------------------------------------------
| 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::any('/register', function() {
  return  view('auth.login');
});
// Main Page Route
/* Route::get('/', [HomePage::class, 'index'])->name('pages-home');
 */ Route::get('/page-2', [Page2::class, 'index'])->name('pages-page-2');

// pages
Route::get('/pages/misc-error', [MiscError::class, 'index'])->name('pages-misc-error');
Route::any('/pos_app_login', [App\Http\Controllers\UserController::class, 'pos_app_login'])->name('pos_app_login');

Route::middleware(['auth', 'web'])->group(function () {
  Route::get('/', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
  Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home-dashboard');

  Route::get('/getparent/{id}', [App\Http\Controllers\HomeController::class, 'getParent'])->name('getparent');
  Route::get('/getservice/{id}/{selected?}', [App\Http\Controllers\HomeController::class, 'getService'])->name(
    'getservice'
  );


  Route::resource('users', App\Http\Controllers\UserController::class);
  Route::any('/user/profile', [App\Http\Controllers\UserController::class, 'profile'])->name('profile');
  Route::any('/user/services/{id}', [App\Http\Controllers\UserController::class, 'services'])->name('user_services');

  Route::resource('permissions', App\Http\Controllers\PermissionsController::class);
  Route::resource('roles', App\Http\Controllers\RolesController::class);

  Route::resource('branches', App\Http\Controllers\BranchesController::class);

  Route::resource('menus', App\Http\Controllers\MenuController::class);
Route::resource('categories', App\Http\Controllers\CategoriesController::class);
Route::resource('seats', App\Http\Controllers\SeatsController::class);
Route::resource('items', App\Http\Controllers\ItemsController::class);
Route::resource('customers', App\Http\Controllers\CustomersController::class);
Route::resource('bookings', App\Http\Controllers\BookingsController::class);
Route::resource('coupons', App\Http\Controllers\CouponsController::class);

Route::prefix('reports')->group(function(){

  Route::any('dayend',[ReportsController::class,'dayend'])->name('reports.dayend');
  Route::get('dayend/show/{id}',[ReportsController::class,'dayendShow'])->name('reports.dayend.show');
  Route::get('dayend/print/{id}',[ReportsController::class,'dayendPrint'])->name('reports.dayend.print');
  Route::get('sales',[ReportsController::class,'sales'])->name('reports.sales');
  Route::get('sales/show/{id}',[ReportsController::class,'salesShow'])->name('reports.sales.show');
  Route::get('bestselling',[ReportsController::class,'bestselling'])->name('reports.bestselling');


});


});






