<?php
class ClientPage extends Page {
  public function projects() {
    return page('projects')->children()->filterBy('intendedTemplate', 'project')->filterBy(function($project) {
        return $project->client()->toPage() === $this;
    }); 
  }
  public function projectsListed() {
    return page('projects')->children()->listed()->filterBy('intendedTemplate', 'project')->filterBy(function($project) {
        return $project->client()->toPage() === $this;
    }); 
  }
  public function projectsUnlisted() {
    return page('projects')->children()->unlisted()->filterBy('intendedTemplate', 'project')->filterBy(function($project) {
        return $project->client()->toPage() === $this;
    }); 
  }
}
