public function isValidToken($token) { $check = Model::Wstoken()->where(['token', '=', (string) $token])->cursor()->count(); return $check == 1 ? true : false; }
function createUserWithOptions($user, $options = []) { $people = Model::People()->firstOrCreate($user); if (!empty($options)) { foreach ($people as $key => $option) { opt($people)->set($key, $option); } } return opt($people)->all(); }