/**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(Request $request)
 {
     $account = new Accounts();
     $account->email = $request['email'];
     $account->MD5Password = md5($this->salt . $request['password']);
     $account->AccountStatus = 100;
     $account->IsDeveloper = 0;
     $account->ReferralID = 0;
     $account->dateregistered = (new \DateTime())->format('Y-m-d H:i:s');
     $account->save();
     $user = new UsersData();
     $user->CustomerID = $account->CustomerID;
     $user->AccountStatus = 100;
     $user->IsDeveloper = 0;
     $user->AccountType = 2;
     $user->GamePoints = 0;
     $user->GameDollars = 0;
     $user->dateregistered = (new \DateTime())->format('Y-m-d H:i:s');
     $user->lastjoineddate = '1973-01-01 00:00:00.000';
     $user->lastgamedate = '1973-01-01 00:00:00.000';
     $user->ClanID = 0;
     $user->ClanRank = 99;
     $user->CharsCreated = 0;
     $user->TimePlayed = 0;
     $user->DateActiveUntil = '2030-01-01 00:00:00.000';
     $user->BanCount = 0;
     $user->save();
     return redirect('login');
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $account = Accounts::findOrFail($id);
     $account->fill($request->all());
     $account->save();
     return redirect()->back();
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function find(Request $request)
 {
     $accounts = Accounts::join('UsersData', 'Accounts.CustomerID', '=', 'UsersData.CustomerID')->where('Accounts.email', 'like', '%' . $request->input('search') . '%')->paginate(20);
     //->get();
     //dd($accounts);
     return view('accounts', compact('accounts'));
 }
Example #4
0
 public function buscar_account(Request $request)
 {
     if ($request->ajax()) {
         $name = "";
         $account = Accounts::find($request->value_cuenta);
         if ($account != null) {
             $name = $account->name;
         }
         return response()->json(array('success' => true, 'html' => $name));
     }
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function find(Request $request)
 {
     $characters = Accounts::select('Accounts.CustomerID', 'UsersChars.CharID', 'UsersChars.Gamertag', 'UsersChars.Alive', 'UsersChars.Health', 'UsersChars.XP', 'UsersChars.Reputation')->join('UsersChars', 'Accounts.CustomerID', '=', 'UsersChars.CustomerID')->where('UsersChars.Gamertag', 'like', '%' . $request->input('search') . '%')->orderby('UsersChars.CharID', 'asc')->paginate(20);
     //->get();
     //dd($accounts);
     return view('characters', compact('characters'));
 }