Learner\Repositories\Eloquent\UserRepository::toggleActive PHP Method

toggleActive() public method

Change user's status.
public toggleActive ( integer $id ) : boolean
$id integer
return boolean
    public function toggleActive($id)
    {
        $user = $this->findWithTrashedById($id);
        $user->update(['is_active' => !$user->is_active]);
        return $user->is_active;
    }