public function login($username = null, $password = null) { $user = $this->find($username); if ($user) { if ($this->data()->password === Hash::make($password, $this->data()->salt)) { Session::put($this->_sessionName, $this->data()->id); return true; } } return false; } public function data() { return $this->_data; }