Search by

Data adapter foundations for Laravel and Inertia applications.

Package info

github.com/artisan-toolbox/dapter

pkg:composer/artisan-toolbox/dapter

Statistics

Installs: 225

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 1

1.0.0-beta.4 2026-11-20 23:33 UTC

This package is auto-updated.

Last update: 2026-11-20 23:40:06 UTC


README

Dapter

version Packagist PHP Laravel Tests Docs

Headless data listings for Laravel and Vue.

Dapter connects Laravel data sources to headless Vue listings. Add search, filters, sorting, pagination, and authorized actions to your own presentation. Dapter is in beta, and its public API may change before the first stable release.

Installation

Check the installation requirements. From the root of a Laravel application with Inertia and Vue, run Composer before npm.

composer require 'artisan-toolbox/dapter:@beta' tightenco/ziggy
npm pkg set 'dependencies.@artisan-toolbox/dapter=file:vendor/artisan-toolbox/dapter'
npm install --install-links

Usage

Complete the installation guide, then create app/DataSources/Products.php:

<?php

namespace App\DataSources;

use ArtisanToolbox\Dapter\Attributes\PublicAccess;
use ArtisanToolbox\Dapter\CollectionDataSource;

#[PublicAccess]
final class Products extends CollectionDataSource
{
    /** @return list<array{name: string}> */
    public function source(): array
    {
        return [['name' => 'Notebook'], ['name' => 'Pencil']];
    }
}

Expose the package route dapter.data through Ziggy, keep Laravel's web session and CSRF integration, and render the source in an existing Inertia page:

<script setup>
import { DataAdapter } from '@artisan-toolbox/dapter';
</script>

<template>
    <DataAdapter source="Products" v-slot="adapter">
        <p v-if="adapter.paging.loading">Loading...</p>
        <p v-if="adapter.error" role="alert">{{ adapter.error.message }}</p>
        <ul v-if="adapter.ready">
            <li v-for="(product, index) in adapter.data" :key="index">
                {{ product.name }}
            </li>
        </ul>
    </DataAdapter>
</template>

After loading, the list displays Notebook and Pencil. The example uses the public attribute to allow guest access. Dapter requires authentication by default. Run the functional examples for paging, configuration, and access behavior.

Documentation and policies