artisan-toolbox / dapter
Data adapter foundations for Laravel and Inertia applications.
Requires
- php: ^8.5
- artisan-toolbox/maintainer: ^1.14.3
- illuminate/auth: ^13.0
- illuminate/broadcasting: ^13.0
- illuminate/cache: ^13.0
- illuminate/console: ^13.0
- illuminate/container: ^13.0
- illuminate/contracts: ^13.0
- illuminate/database: ^13.0
- illuminate/encryption: ^13.0
- illuminate/filesystem: ^13.0
- illuminate/http: ^13.0
- illuminate/queue: ^13.0
- illuminate/routing: ^13.0
- illuminate/support: ^13.0
- inertiajs/inertia-laravel: ^3.0
- symfony/polyfill-intl-normalizer: ^1.33
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-20 23:40:06 UTC
README
Dapter
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.