PHPackages                             brandonjjon/laravel-printavo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. brandonjjon/laravel-printavo

ActiveLibrary[Database &amp; ORM](/categories/database)

brandonjjon/laravel-printavo
============================

Laravel package providing an Eloquent-like interface to the Printavo GraphQL API

v1.0.1(5mo ago)02[1 PRs](https://github.com/brandonjjon/laravel-printavo/pulls)MITPHPPHP ^8.2CI passing

Since Jan 14Pushed 2mo agoCompare

[ Source](https://github.com/brandonjjon/laravel-printavo)[ Packagist](https://packagist.org/packages/brandonjjon/laravel-printavo)[ Docs](https://github.com/brandonjjon/laravel-printavo)[ RSS](/packages/brandonjjon-laravel-printavo/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (8)Versions (4)Used By (0)

Laravel Printavo
================

[](#laravel-printavo)

[![Tests](https://github.com/brandonjjon/laravel-printavo/actions/workflows/run-tests.yml/badge.svg)](https://github.com/brandonjjon/laravel-printavo/actions/workflows/run-tests.yml)[![PHPStan](https://github.com/brandonjjon/laravel-printavo/actions/workflows/phpstan.yml/badge.svg)](https://github.com/brandonjjon/laravel-printavo/actions/workflows/phpstan.yml)[![Latest Version on Packagist](https://camo.githubusercontent.com/7fe7294101a36c370cb876b66721f4804e1ebb815915ca682df0dbdcb094cf72/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6272616e646f6e6a6a6f6e2f6c61726176656c2d7072696e7461766f2e737667)](https://packagist.org/packages/brandonjjon/laravel-printavo)[![Total Downloads](https://camo.githubusercontent.com/3661fae70727a4d8045b16f5d700d4e290b0f50faeb282b04bdc6bb3b36e6779/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6272616e646f6e6a6a6f6e2f6c61726176656c2d7072696e7461766f2e737667)](https://packagist.org/packages/brandonjjon/laravel-printavo)[![License](https://camo.githubusercontent.com/49f788714213adcb961231f62116dad54b5b270dcfa20257f2d731a7df9ebdc0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6272616e646f6e6a6a6f6e2f6c61726176656c2d7072696e7461766f2e737667)](https://packagist.org/packages/brandonjjon/laravel-printavo)

A Laravel package providing an Eloquent-like interface to the Printavo GraphQL API. Query customers, orders, invoices, and more using familiar Laravel patterns.

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require brandonjjon/laravel-printavo
```

Publish the configuration file:

```
php artisan vendor:publish --tag="printavo-config"
```

Configuration
-------------

[](#configuration)

Add your Printavo API credentials to your `.env` file:

```
PRINTAVO_EMAIL=your-email@example.com
PRINTAVO_TOKEN=your-api-token
```

You can find your API credentials in your Printavo account settings under API Access.

### Optional Configuration

[](#optional-configuration)

```
# Caching (enabled by default)
PRINTAVO_CACHE_ENABLED=true
PRINTAVO_CACHE_TTL=300
PRINTAVO_CACHE_STORE=redis

# Rate limiting (10 requests per 5 seconds by default)
PRINTAVO_RATE_LIMIT_REQUESTS=10
PRINTAVO_RATE_LIMIT_SECONDS=5
PRINTAVO_RATE_LIMIT_BEHAVIOR=wait  # or 'throw'
```

Usage
-----

[](#usage)

### Basic Queries

[](#basic-queries)

```
use Brandonjjon\Printavo\Facades\Printavo;

// Get all customers (returns Collection)
$customers = Printavo::customers()->get();

// Collection methods work as expected
$count = $customers->count();
$first = $customers->first();
$filtered = $customers->filter(fn ($c) => $c->orderCount > 10);

// Find a customer by ID
$customer = Printavo::customers()->find('abc123');

// Get the first customer
$customer = Printavo::customers()->first();
```

### Filtering

[](#filtering)

Each query builder has typed filter methods generated from the GraphQL schema.

```
use Brandonjjon\Printavo\Data\Generated\Enums\OrderPaymentStatus;
use Brandonjjon\Printavo\Data\Generated\Enums\OrderSortField;

// Filter by payment status (enum)
$unpaid = Printavo::invoices()
    ->paymentStatus(OrderPaymentStatus::Unpaid)
    ->get();

// Filter by date range
$invoices = Printavo::invoices()
    ->inProductionAfter('2024-01-01')
    ->inProductionBefore('2024-12-31')
    ->get();

// Sort results
$invoices = Printavo::invoices()
    ->sortOn(OrderSortField::CustomerDueAt)
    ->sortDescending(true)
    ->get();

// Search with query string
$invoices = Printavo::invoices()
    ->query('acme corp')
    ->get();

// Filter by status IDs (get IDs from Printavo::statuses()->get())
$statuses = Printavo::statuses()->get();
$invoices = Printavo::invoices()
    ->statusIds([$statuses->first()->id])
    ->get();
```

Use your IDE's autocomplete to discover available filter methods for each resource.

### Selecting Fields

[](#selecting-fields)

Use field constants for type-safe field selection:

```
use Brandonjjon\Printavo\Data\Generated\Fields\CustomerFields;

$customers = Printavo::customers()
    ->select([
        CustomerFields::ID,
        CustomerFields::COMPANY_NAME,
        CustomerFields::ORDER_COUNT,
    ])
    ->get();
```

### Pagination

[](#pagination)

```
// Paginate results (cursor-based)
$page = Printavo::customers()->paginate(25);

// Access items
foreach ($page->items() as $customer) {
    echo $customer->companyName;
}

// Get the next page
if ($page->hasMorePages()) {
    $nextPage = Printavo::customers()
        ->cursor($page->getNextCursor())
        ->paginate(25);
}
```

### Limiting Results

[](#limiting-results)

```
// Get only 10 customers
$customers = Printavo::customers()->take(10)->get();
```

### Creating Records

[](#creating-records)

```
use Brandonjjon\Printavo\Data\Generated\CustomerCreateInput;

$response = Printavo::customerMutations()->create(
    new CustomerCreateInput(
        companyName: 'Acme Corp',
        // ... other fields
    )
);

if ($response->successful()) {
    $customer = $response->data();
}
```

### Updating Records

[](#updating-records)

```
use Brandonjjon\Printavo\Data\Generated\CustomerInput;

$response = Printavo::customerMutations()->update(
    'customer-id',
    new CustomerInput(
        companyName: 'Acme Corporation',
    )
);
```

### Deleting Records

[](#deleting-records)

```
$response = Printavo::customerMutations()->delete('customer-id');
```

Available Resources
-------------------

[](#available-resources)

### Queries

[](#queries)

MethodDescription`contacts()`Query contacts`customers()`Query customers`inquiries()`Query inquiries`invoices()`Query invoices`merchStores()`Query merch stores`orders()`Query orders`paymentRequests()`Query payment requests`products()`Query products`quotes()`Query quotes`statuses()`Query statuses`tasks()`Query tasks`threads()`Query threads`transactions()`Query transactions### Mutations

[](#mutations)

MethodOperations`contactMutations()`create, update, delete`customerMutations()`create, update, delete`customAddressMutations()`create, creates, update, updates, delete, deletes`feeMutations()`create, creates, update, updates, delete, deletes`imprintMutations()`create, creates, update, updates, delete, deletes`invoiceMutations()`update, delete, duplicate`lineItemMutations()`create, creates, update, updates, delete, deletes`lineItemGroupMutations()`create, creates, update, updates, delete, deletes`quoteMutations()`create, update, delete, duplicate`taskMutations()`create, update, delete`threadMutations()`update`transactionPaymentMutations()`create, update, delete...and moreSee full API documentationDTOs
----

[](#dtos)

All responses are hydrated into typed Data Transfer Objects with IDE autocompletion support:

```
$customer = Printavo::customers()->find('abc123');

// All properties are typed
echo $customer->id;           // string
echo $customer->companyName;  // ?string
echo $customer->orderCount;   // ?int
echo $customer->timestamps->createdAt; // ?Carbon
```

Error Handling
--------------

[](#error-handling)

```
use Brandonjjon\Printavo\Exceptions\PrintavoException;
use Brandonjjon\Printavo\Exceptions\RateLimitException;

try {
    $customers = Printavo::customers()->get();
} catch (RateLimitException $e) {
    // Handle rate limit (only thrown if behavior is 'throw')
} catch (PrintavoException $e) {
    // Handle API errors
    echo $e->getMessage();
}
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance80

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

170d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/507435?v=4)[Brandon Jones](/maintainers/brandonjjon)[@brandonjjon](https://github.com/brandonjjon)

---

Top Contributors

[![brandonjjon](https://avatars.githubusercontent.com/u/507435?v=4)](https://github.com/brandonjjon "brandonjjon (8 commits)")

---

Tags

apilaravelgraphqleloquentprintavo

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/brandonjjon-laravel-printavo/health.svg)

```
[![Health](https://phpackages.com/badges/brandonjjon-laravel-printavo/health.svg)](https://phpackages.com/packages/brandonjjon-laravel-printavo)
```

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k54.9M11.6k](/packages/illuminate-database)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.6k3](/packages/defstudio-telegraph)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M345](/packages/psalm-plugin-laravel)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

44855.7k](/packages/harris21-laravel-fuse)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
