Search by

Data adapter foundations for Laravel and Inertia applications.

Package info

github.com/artisan-toolbox/dapter

pkg:composer/artisan-toolbox/dapter

Statistics

Installs: 12

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.x-dev 2026-11-16 23:51 UTC

This package is auto-updated.

Last update: 2026-11-16 23:51:12 UTC


README

Dapter

Preview PHP Laravel Tests Docs

Data adapter foundations for Laravel and Inertia applications.

Dapter reads and paginates server-owned data through a headless Vue adapter. This unpublished local preview supports Collections and ordinary SQLite Eloquent queries, offset paging, typed options, PHP attributes, and guard and Gate access checks.

Installation

For the local preview, place this checkout beside your Laravel application. From the application root, run:

composer config repositories.dapter path ../dapter
composer require artisan-toolbox/dapter:"1.x-dev@dev"
npm pkg set 'dependencies.@artisan-toolbox/dapter=file:vendor/artisan-toolbox/dapter'
npm install --install-links

Usage

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">
        <pre v-if="adapter.ready">{{ adapter.data }}</pre>
    </DataAdapter>
</template>

After loading, the slot contains the two records. The public attribute is explicit for this fictional catalog; authentication is required by default. Run the functional examples for paging, configuration, and access behavior.

Compatibility

PHP ^8.5, Laravel ^13.0, Inertia Laravel ^3.0, Inertia Vue and Core ^3.0.3, Vue ^3.5.40, Ziggy ^2.6.5, and Node.js >=24.11.0 for frontend tooling. The source entry needs Vue-aware Vite and TypeScript tooling, plus optimizeDeps.exclude for @artisan-toolbox/dapter during development. Follow the installation guide for the consuming application's Vite configuration. Search, filters, selectable ordering, MySQL, PostgreSQL, URL persistence, scrolling, and live updates remain planned. The preview uses 1.x and has no stable release.

Documentation and policies