<?php

use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Route;
use Mehrab\OrderService\Http\Controllers\OrderServiceFrontController;
use Mehrab\Sms\Services\SmsService;

/*
|--------------------------------------------------------------------------
| 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!
|
*/

//
//Route::get('upload',[\App\Http\Controllers\testUploadController::class,'index']);
//Route::post('upload',[\App\Http\Controllers\testUploadController::class,'store']);

//Route::get('test/s',function (){
//    \Illuminate\Support\Facades\Auth::logout();
//    $user = auth()->loginUsingId(1);
//    $user->assignRole(\Mehrab\RolePermission\Models\Role::ROLE_SUPER_ADMIN);
//    return auth()->user()->permissions;
//});
//Route::get('test/t1',function (){
//    \Illuminate\Support\Facades\Auth::logout();
//    $user = auth()->loginUsingId(5);
////    $user->assignRole(\Mehrab\RolePermission\Models\Role::ROLE_SUPER_ADMIN);
//    return auth()->user()->permissions;
//});
//Route::get('test/t2',function (){
//    \Illuminate\Support\Facades\Auth::logout();
//    $user = auth()->loginUsingId(6);
////    $user->assignRole(\Mehrab\RolePermission\Models\Role::ROLE_SUPER_ADMIN);
//    return auth()->user()->permissions;
//});
//Route::get('test/t3',function (){
//    \Illuminate\Support\Facades\Auth::logout();
//    $user = auth()->loginUsingId(7);
////    $user->assignRole(\Mehrab\RolePermission\Models\Role::ROLE_SUPER_ADMIN);
//    return auth()->user()->permissions;
//});
//Route::get('test/o1',function (){
//    \Illuminate\Support\Facades\Auth::logout();
//    $user = auth()->loginUsingId(2);
////    $user->assignRole(\Mehrab\RolePermission\Models\Role::ROLE_SUPER_ADMIN);
//    return auth()->user()->permissions;
//});
//Route::get('test/o2',function (){
//    \Illuminate\Support\Facades\Auth::logout();
//    $user = auth()->loginUsingId(3);
////    $user->assignRole(\Mehrab\RolePermission\Models\Role::ROLE_SUPER_ADMIN);
//    return auth()->user()->permissions;
//});
//Route::get('test/o3',function (){
//    \Illuminate\Support\Facades\Auth::logout();
//    $user = auth()->loginUsingId(4);
////    $user->assignRole(\Mehrab\RolePermission\Models\Role::ROLE_SUPER_ADMIN);
//    return auth()->user()->permissions;
//});
//Route::get('test/e1',function (){
//    \Illuminate\Support\Facades\Auth::logout();
//    $user = auth()->loginUsingId(8);
////    $user->assignRole(\Mehrab\RolePermission\Models\Role::ROLE_SUPER_ADMIN);
//    return auth()->user()->permissions;
//});
//Route::get('test/e2',function (){
//    \Illuminate\Support\Facades\Auth::logout();
//    $user = auth()->loginUsingId(9);
////    $user->assignRole(\Mehrab\RolePermission\Models\Role::ROLE_SUPER_ADMIN);
//    return auth()->user()->permissions;
//});
//Route::get('test/e3',function (){
//    \Illuminate\Support\Facades\Auth::logout();
//    $user = auth()->loginUsingId(10);
////    $user->assignRole(\Mehrab\RolePermission\Models\Role::ROLE_SUPER_ADMIN);
//    return auth()->user()->permissions;
//});
//Route::get('test/all1',function (){
//    \Illuminate\Support\Facades\Auth::logout();
//    $user = auth()->loginUsingId(15);
////    dd(\Illuminate\Support\Facades\Auth::check());
//
////    $user->assignRole(\Mehrab\RolePermission\Models\Role::ROLE_SUPER_ADMIN);
//    return auth()->user()->givePermissionTo(\Mehrab\RolePermission\Models\Permission::PERMISSION_ACCESS_ALL_ORDER_SERVICE);
//});
//Route::get('test/all2',function (){
//    \Illuminate\Support\Facades\Auth::logout();
////    $user = auth()->loginUsingId(15);
//
////    $user->assignRole(\Mehrab\RolePermission\Models\Role::ROLE_SUPER_ADMIN);
//    return auth()->user()->givePermissionTo(\Mehrab\RolePermission\Models\Permission::PERMISSION_ACCESS_ALL_ORDER_SERVICE);
//});
//Route::get('test/f',function (){
//    \Illuminate\Support\Facades\Auth::logout();
//    $user = auth()->loginUsingId(24);
////    $user->assignRole(\Mehrab\RolePermission\Models\Role::ROLE_SUPER_ADMIN);
//    return auth()->user()->givePermissionTo(\Mehrab\RolePermission\Models\Permission::PERMISSION_ORDER_SERVICE_FACTOR);
//});
//Route::get('test/user',function (){
//    \Illuminate\Support\Facades\Auth::logout();
//     auth()->loginUsingId(11,true);
//
////     dd(\Illuminate\Support\Facades\Auth::check());
////    $user->assignRole(\Mehrab\RolePermission\Models\Role::ROLE_USER);
//    return auth()->user()->givePermissionTo(\Mehrab\RolePermission\Models\Permission::PERMISSION_USER);
//});
//Route::get('test/mp',function (){
//    \Illuminate\Support\Facades\Auth::logout();
//    auth()->loginUsingId(13,true);
//
////     dd(\Illuminate\Support\Facades\Auth::check());
////    $user->assignRole(\Mehrab\RolePermission\Models\Role::ROLE_USER);
//    return auth()->user()->givePermissionTo(\Mehrab\RolePermission\Models\Permission::PERMISSION_MANAGE_PAYMENT);
//});
//Route::any('/logouttt',function (){
//    \Illuminate\Support\Facades\Auth::logout();
//});
//Route::get('home',function (){
//    return view('newerFront.index');
//});
//Route::get('service',function (){
//    return view('newerFront.serviceDetails');
//});
//Route::get('sms',function (){
//    SmsService::send(['test1'],['09371351225']);
//});
//Route::get('ultra',function (){
//    \Mehrab\Sms\Jobs\SendUltraSmsJob::dispatch('register', [17175,'hello welcome'], '09371351225')->onQueue('sendUltraSms')->delay(now()->addSecond(2));
//
//});
// Route::get('ultra',function (){
// //    \Mehrab\Sms\Jobs\SendUltraSmsJob::dispatch('forgotPass', [17175], '09371351225')->onQueue('sendUltraSms')->delay(now()->addSecond(2));
//   $cache = Cache::put('test','22222',600);

//     SmsService::ultra('forgotPass', [Cache::get('test')], '09371351225');
// });


//Route::get('payment/test', function (){
//    $payment = \Mehrab\Payment\Models\Payment::query()->where('id',14)->firstOrFail();
//     event(new \Mehrab\Payment\Events\PaymentWasSuccessfulEvent($payment));
//})

Route::group(["prefix"=>"admin","middleware"=>"auth"],function (){
    Route::post("/group-action","AdminController@group_action")->name("admin_group_action");
});

?>
