<?php

use App\Http\Controllers\UserController;
use Illuminate\Support\Facades\Route;

Route::get('/user/me',               [UserController::class, 'me'])->withoutMiddleware('provider.accepted');
Route::match(['put', 'post'], '/me', [UserController::class, 'updateMe'])->middleware('permission:config.user,edit');
Route::get('/user',                  [UserController::class, 'index'])->middleware('permission:config.user,view');
Route::post('/user',                 [UserController::class, 'store'])->middleware('permission:config.user,add');
Route::get('/user/{id}',             [UserController::class, 'show'])->middleware('permission:config.user,view');
Route::put('/user/{id}',             [UserController::class, 'update'])->middleware('permission:config.user,edit');
Route::delete('/user/{id}',          [UserController::class, 'destroy'])->middleware('permission:config.user,delete');
Route::get('/user-types',            [UserController::class, 'getUserTypes'])->middleware('permission:config.user,view');
