Giter Club home page Giter Club logo

livewire-datatables's Introduction

Livewire Datatables

License Latest Stable Version Total Downloads Unit-Tests StyleCI codecov

An awesome package for easy dynamic datatables with Laravel Livewire and Bootstrap v4.

Installation

You can install the package via composer:

composer require nodus-it/livewire-datatables

You can publish the config file with:

php artisan vendor:publish --provider="Nodus\Packages\LivewireDatatables\LivewireDatatablesServiceProvider" --tag="livewire-datatables:config"

You can publish the blade views with:

php artisan vendor:publish --provider="Nodus\Packages\LivewireDatatables\LivewireDatatablesServiceProvider" --tag="livewire-datatables:views"

Now with the package installed we need to set up some things in order for things to properly work.

First of all, all prerequisites of the livewire library are of course required. For these steps consult: https://laravel-livewire.com/docs/2.x/installation

Second you should check the configs of the core package and this package and make sure all settings work for your project. Especially the blade stack names for styles and scripts could potentially differ from our defaults!

Additionally, we need to include the styles of the livewire datatable package.

@livewireDatatableStyles

Usage

General tooling

For information of the general tooling around this package (e.g. full component rendering, CSP support, ...) please consult the core package documentation under: https://github.com/nodus-it/livewire-core

The DataTable component

Todo

The ConfirmModal component

Add the confirm-modal component to your layout at entrance level of your documents body.

<body>
    <!-- Much content... -->
    
    <livewire:livewire-datatables.confirm-modal/>
</body>

Now you're already good to go for the confirmation buttons of your datatables.

Furthermore, it's possible to use the confirm-modal component from outside the datatable aswell. You simply need to emit the confirm:show event:

In livewire components:

wire:click="$emit('confirm:show', 'url')"

Out of livewire components:

onClick="Livewire.emit('confirm:show', 'url')"

With the third parameter it is possible to customize the modal texts and colors. For further details take a look inside the ConfirmModal class.

Roadmap

  • Support for search keys through multiple relations
  • Support for sort keys through relations
  • Advanced scopes
  • More themes (Tailwind3, Bootstrap5)
  • Fix the query rebuilding problem (currently using the IDs array) by using EloquentBuilder serialization

Testing

composer test

License

The MIT License (MIT). Please see License File for more information.

livewire-datatables's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.