/**
  * Handle the event.
  *
  * @param  Events  $event
  * @return void
  */
 public function handle(User $user, $remember)
 {
     $user->online = TRUE;
     $user->save();
     $at = new AuditTrail();
     $at->user_id = $user->_id;
     $at->user_name = $user->name;
     $at->event_name = "Logged in";
     $at->event_description = "";
     $at->event_date = \Carbon::now();
     $at->ip = $_SERVER['REMOTE_ADDR'];
     $at->browser = $_SERVER['HTTP_USER_AGENT'];
     $at->save();
 }
示例#2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     User::destroy($id);
     return redirect()->route('users.index');
 }
示例#3
0
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     return User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]);
 }