Giter Site home page Giter Site logo

ramonrietdijk / livewire-tables Goto Github PK

View Code? Open in Web Editor NEW
188.0 6.0 9.0 981 KB

Dynamic tables for models with Laravel Livewire

Home Page: https://livewire-tables.ramonrietdijk.nl/

License: MIT License

JavaScript 0.01% Blade 22.39% PHP 77.61%
laravel livewire tables

livewire-tables's Introduction

Livewire Tables

GitHub Workflow Status MIT Licensed Latest Version on Packagist

Easily create dynamic tables for models with Laravel Livewire.

Livewire Table

If you enjoy using this package, please consider leaving a star.

Demo

See the Livewire Table in action.

Documentation

Open the documentation to see how this package can be used with examples.

Testing

To make sure everything works, run the following command:

composer quality

Credits

License

This package is released under the MIT license.

livewire-tables's People

Contributors

bleuren avatar kenkodz avatar omranic avatar ramonrietdijk avatar vincentbean avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

livewire-tables's Issues

Extra button

Excuse me, is there a way to add a button within the bar above the table, preferablly on the upper right corner before other buttons, like shown below?

addbutton

Idea: Addable, Editable, Deletable

You're on a roll, so I thought I throw this out there. This is such a big ask, that I am not even requesting the feature, merely putting it out there into the ether.

For Addable, I am envisioning a button in the bar that would show when protected bool $addable = true;. This button would show a modal that contains fields for all the Columns and would have Add and Cancel buttons.

For Editable, I'm thinking having protected bool $editable = true; show an edit icon in an actions column that would make each of the columns change into fields and the edit icon would change into a save button. Alternatively, it could show a modal like Addable.

For Deletable, it'd simply have protected bool $deleteable = true; show a trash icon in the actions column that would have a confirmation before deleting the row.

I am thinking about working on this myself, but you've been so quick and elegant with the updates, I'd hate to waste time building it differently than you'd do it. :-)

Feature Request: Support Project Through GitHub Sponsors

I'd like the ability to donate some money to help support this project. It might only be enough for a cup of coffee or a cool brew, but I'd like to show my appreciation for your work here. Perhaps you can turn on GitHub Sponsors.

Feature Request: Add ability to add non-livewire buttons to the table's bar

It would be nice if there was a way to add a button (or an action to the action button) that would allow me to use JavaScript (specifically AlpineJS) instead of Livewire for the button's action.

The use case is for things like showing a modal. While this is easy to do in Livewire, sometimes you don't want to have to send a request to the server just to make something visible.

I put some thought into how to do it. I thought about making another trait for button's or just making changes to the actions.blade.php for standalone actions. but I just couldn't wrap my head around how I'd handle passing the JavaScript to it. Perhaps it's too early in the morning. lol

This is a LOW priority request as I am able to just use Livewire for it.

Thank you for building this and considering the requests that are coming in.

Feature Request: Add row selection options

Being able to select multiple rows is a great feature to have but could be improved upon.

Sometimes selecting rows is not needed at all and would be great if it could be turned off as simply as Reordering. If there is nothing for a user to do when the rows are selected, then it can be confusing to users as to why they can select them in the first place.

Also, if it is enabled, there are times where you might want to specify the number of rows that are allowed to be selected. Having a property that specifies the maximum number of rows would be great to have.

Question: Is there a way to hide a columns by default, and persist columns status?

Hey there,

Q1

Is there a way to hide columns by default?
Scenario: define columns but decide to hide some of them in the default display view, which the use can unhide through the table options.

Q2

Also: is there a way to persist column status per session, or in browser localstorage, so that when they refresh the page or browse away and come back they can find their column selections as is, not being reset to the original state. Is this something possible, or planned?

Differences from other livewire datatables

Hey Ramon,

Thanks for the awesome package, I like the simplicity and low overhead of this package.

I was wondering if you can explain some of the differences between this package and the other Livewire datatables, and maybe the motivations behind building yet another package for the same purpose. That might help developers relate, and make their minds to choose this one instead. Would love to hear your perspective :)

Question: How to pass data to views

Hey there,

Is there a way to pass arbitrary data to views, something like:

            ViewColumn::make(trans('lang.var'), 'namespace::view', ['variable' => 'Some Value']),

And inside namespace::view I use it like $variable?

โ“ If this is something not currently supported, are you open to add this feature?


๐Ÿ’ก Why this is useful: Passing arbitrary data to views, enhances the flexibility and promotes reusability of view components. This practice allows developers to inject dynamic data into views, facilitating the creation of more interactive, customized content without hard-coding values. It fosters a modular approach, where components can be customized on-the-fly based on different contexts or user interactions, promoting a cleaner, more maintainable codebase.

Enumerable $models in Action::make

Action::make(__('My Action'), 'my_action', function (Enumerable $models): void { // }),

Excuse me, how to pass selected rows into this Enumerable $models when declaring an Action?

Cannot filter model class

In the model property definition.

How can I limit the data being extracted based on a given condition.

For example I would like to do something like the following.

$model = Blog::where('year',2023)->get();

Feature Request: Slots

Would you be interested in adding slots to the table?

For instance, livewire-table::bar.bar could have x-slot:before-actions, x-slot:after-actions, x-slot:before-search, x-slot:after-search, etc. This would allow for customization without having to publish the templates.

View Column

Another suggestion: in addition to asHtml() implement a 'View Column' column type where one can pass the name of a blade file.

Pull Related Records of a Model as the Base Results

I want to create a table that has a base dataset of all the child records of the specific model that is loaded via Model-Route binding. I don't see a way to do this. Perhaps I am overlooking something.

For example, a phone with the id of 32 has multiple accounts (lines) configured to it. When the user views the phone's configuration (/phone/32), I want to show a table of all the accounts associated with that specific phone and no others.

Any ideas on how I can accomplish this?

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.