Learner\Repositories\Eloquent\UserRepository::toggleActive PHP Méthode

toggleActive() public méthode

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