<?php
use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;
use Portal\Overide\Http\Controllers\UserControllers;

Route::group(
    [
        'namespace'  => '\Portal\Overide\Http\Controllers',
        'prefix'     => '',
        'as'         => 'overide::',
        'middleware' => ['web', 'auth'],
    ],

    function ($router) {

        Route::get('users', ['uses' => 'UserControllers@users', 'as' => 'overide.user']);
        Route::get('create', ['uses' => 'UserControllers@create', 'as' => 'users.create']);
        Route::get('edit/{id}', ['uses' => 'UserControllers@edit', 'as' => 'users.edit']);

        $router->resource('account', 'UserControllers', [

             'names' => [

                'update' => 'account.update',
             ],
             'middleware' => 'can:'.\App\Enums\Permission::MANAGE_USER,
         ]);    


        $router->resource('roles', 'RoleControllers', [
            'names'      => [
                'index'   => 'roles.index',
                'create'  => 'roles.create',
                'store'   => 'roles.store',
                'show'    => 'roles.show',
                'edit'    => 'roles.edit',
                'update'  => 'roles.update',
                'destroy' => 'roles.destroy',
            ],
            'middleware' => 'can:'.\App\Enums\Permission::MANAGE_ROLE,
        ]);
        

     
    }
);


Route::group(
    [
        'namespace'  => '\Portal\Overide\Http\Controllers',
        'prefix'     => '',
        'as'         => 'overide::',
        'middleware' => ['web'],
    ],

    function () {

       

      
    }
);
