NASER add admin levels & fix break button
This commit is contained in:
@@ -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([
|
||||
|
||||
Reference in New Issue
Block a user