NASER add admin levels & fix break button

This commit is contained in:
mobin
2026-04-08 09:22:17 +00:00
parent a6b5f27343
commit fcc50d8ec8
8 changed files with 8543 additions and 8374 deletions
@@ -127,6 +127,48 @@ class AttendanceController extends Controller
// return redirect(route('admin.dashboard'));
// }
// public function login1(Request $request)
// {
//
// $credentials = $request->only(['phone', 'password']);
// $user = User::where('number', $credentials['phone'])->first();
// if($user->is_admin == 0){
// $provider = 'employee';
// }elseif ($user->is_admin == 1){
// $provider = 'admin';
// }elseif ($user->is_admin == 2){
// $provider = 'supervisor';
// }
// return $this->_loginWithPassword($credentials, $provider);
// }
//
// protected function _loginWithPassword($credentials, $provider)
// {
//
//
// $token = auth($provider)->attempt($credentials);
// if (!$token) {
// throw new UnprocessableEntityHttpException('شماره موبایل یا پسوورد وارد شده اشتباه است');
// }
// $user = auth($provider)->user();
//
//
// return $this->respondWithToken($token);
// }
//
// protected function respondWithToken($token)
// {
// return response()->json([
// 'access_token' => $token,
// 'token_type' => 'bearer',
// 'expires_in' => auth()->factory()->getTTL()
// ]);
// }
public function ai()
{
$response = Http::withHeaders([