artisan-toolbox / dapter
Data adapter foundations for Laravel and Inertia applications.
Requires
- php: ^8.5
- artisan-toolbox/maintainer: ^1.10.0
- illuminate/support: ^13.0
- inertiajs/inertia-laravel: ^3.0
Requires (Dev)
- driftingly/rector-laravel: ^2.7.3
- larastan/larastan: ^3.9
- laravel/pao: ^1.0
- laravel/pint: ^1.29
- orchestra/testbench: ^11.0
- pestphp/pest: ^5.0
- pestphp/pest-plugin-laravel: ^5.0
- pestphp/pest-plugin-phpstan: ^5.3
- pestphp/pest-plugin-type-coverage: ^5.1
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.3.5
- phpstan/phpstan-mockery: ^2.0
- rector/rector: ^2.8.4
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-16 23:51:12 UTC
README
Dapter
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.