docirana / tall-datatables
Tailwind, Alpine.js, Laravel, and Livewire simple datatables
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Blade
Requires
- php: ^8.1
- illuminate/support: *
- livewire/livewire: ^v2.12.0
Requires (Dev)
- laravel/pint: ^1.7
- orchestra/testbench: ^8.1
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^8.4|^9.0
- roave/security-advisories: dev-latest
README
Tailwind, Alpine.js, Laravel, and Livewire simple datatables
Installation
You can install the TALL Datatables package via composer.
composer require docirana/tall-datatables
Tailwind Configuration
::: info You can skip this step if you are planning to customize the views. :::
The TALL Datatables has views so you need to adjust your Tailwind CSS config.
/** @type {import('tailwindcss').Config} */ module.exports = { content: [ // ... "./vendor/docirana/tall-datatables/src/views/**/*.blade.php" ] }
Publishing Views
To make the tables blend into the style of your project, you may wish to make changes to the layout. This can be done by publishing the views and customize them any way you like.
php artisan vendor:publish --provider="Docirana\TallDatatables\Providers\TallDatatablesServiceProvider"
Example
php artisan livewire:make ExampleComponent
<?php namespace App\Http\Livewire; use Docirana\TallDatatables\TallDatatables; use Illuminate\Database\Eloquent\Builder as EloquentBuilder; use Illuminate\Database\Query\Builder as QueryBuilder; use Illuminate\Support\Collection; class ExampleComponent extends TallDatatables { public function headerData(): Collection { // TODO: Implement headerData() method. } public function dataRaw(): array|Collection|QueryBuilder|EloquentBuilder { // TODO: Implement dataRaw() method. } }
!!! by the dataRaw you need to specify only one return type !!! This is depending on your data.