<?php

use Illuminate\Support\Facades\Route;
use App\Utils\Agbonon;
use App\Http\Controllers\EntrepriseController;
use App\Http\Controllers\RoleController;
use App\Http\Controllers\MenuController;
//use App\Http\Controllers\UserController;
use App\Http\Controllers\Api\AuthController;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

//Agbonon::crudResource('companies','EntrepriseController', false);
//Route::get('/companies',[EntrepriseController::class,'index']);
//Agbonon::crudResource('menu','MenuController');
//Agbonon::crudResource('roles','App\Http\Controllers\RoleController', false);
//Agbonon::crudResource('users','UserController', false);

//Route::get('/users', [App\Http\Controllers\UserController::class, 'index']);
//Route::get('/roles', [RoleController::class, 'index']);



Route::get('/scan', [AuthController::class, 'showOrderForm'])->name('scan.form');    
    
Route::post('/order/store', [AuthController::class, 'storeOrder'])->name('order.store');

Route::group(['prefix' => config('app.admin_prefix'), 'namespace'=>'\\App\\Http\\Controllers', 'middleware'=> ['auth']], function(){

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

    Agbonon::crudResource('companies','EntrepriseController',false);
    Agbonon::crudResource('brands','BrandController');
    Agbonon::crudResource('stores','StoreController', false);
    Agbonon::crudResource('offers','TypeOperationController');

    Agbonon::crudResource('recompenses','RecompenseController');
    Agbonon::crudResource('notation_systems','NotationSystemController');
    Agbonon::crudResource('loyalty_program','ProgrammeFideliteController',false);

    Agbonon::crudResource('transactions','TransactionController');

    Agbonon::crudResource('menu','MenuController');
    Agbonon::crudResource('roles','RoleController', false);
    Agbonon::crudResource('users','UserController', false);



    

    

});

Auth::routes();