/**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public static function login(Request $request)
 {
     $input = $request::all();
     $username = $request::get('username');
     $password = $request::get('password');
     if ($username == null || $password == null) {
         return ApiController::wrongDataFormat();
     }
     $user = User::where('username', '=', $username)->first();
     if ($user == null) {
         return UserApiController::usernameNotFound();
     }
     if (!Hash::check($password, $user['password'])) {
         return response()->json(['code' => 4]);
     }
     return response()->json(['code' => 0, 'user' => $user]);
 }