public function create(UserInterface $user)
  {
    if($user == null || $user->getAuthIdentifier() == null) {
      return false;
    }

    $token = $this->generateAuthToken();
    $token->setAuthIdentifier( $user->getAuthIdentifier() );

    $t = new \DateTime;
    $insertData = array_merge($token->toArray(), array(
       'created_at' => $t, 'updated_at' => $t
    ));

    $this->db()->insert($insertData);

    return $token;
  }
public function create(UserInterface $user)
  {
    if($user == null || $user->getAuthIdentifier() == null) {
      return false;
    }

    $token = $this->generateAuthToken();
    $token->setAuthIdentifier( $user->getAuthIdentifier() );

    $t = new \DateTime;
    $insertData = array_merge($token->toArray(), array(
       'created_at' => $t, 'updated_at' => $t
    ));

    $this->db()->insert($insertData);

    return $token;
  }
public function create ( UserInterface $ user ) { if ( $ user == null || $ user -> getAuthIdentifier ( ) == null ) { return false ; } $ token = $ this -> generateAuthToken ( ) ; $ token -> setAuthIdentifier ( $ user -> getAuthIdentifier ( ) ) ; $ t = new \ DateTime ; $ insertData = array_merge ( $ token -> toArray ( ) , array ( 'created_at' => $ t , 'updated_at' => $ t ) ) ; $ this -> db ( ) -> insert ( $ insertData ) ; return $ token ; }
Creates an auth token for user.

@param \Illuminate\Auth\UserInterface $user
@return \TAppleby\AuthToken\AuthToken|false
Creates an auth token for user .