App\Http\Controllers\ClientApiController::index PHP Method

index() public method

public index ( )
    public function index()
    {
        $clients = Client::scope()->orderBy('created_at', 'desc')->withTrashed();
        // Filter by email
        if ($email = Input::get('email')) {
            $clients = $clients->whereHas('contacts', function ($query) use($email) {
                $query->where('email', $email);
            });
        }
        return $this->listResponse($clients);
    }