Download the PHP package bored-programmers/laragrid without Composer
On this page you can find all versions of the php package bored-programmers/laragrid. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bored-programmers/laragrid
More information about bored-programmers/laragrid
Files in bored-programmers/laragrid
Package laragrid
Short Description LaraGrid is a powerful and customizable grid system package for Laravel. It provides an easy way to create sortable, filterable tables with pagination. The package is designed to be highly customizable, allowing developers to define columns, apply filters, and sort data with ease.Key Features:- **Column Definition**: LaraGrid allows you to define the columns that will be displayed in the grid. You can specify the model field and the label for each column.- **Filters**: The package provides several filter classes out of the box, including text, select, date, and boolean filters. These filters can be applied to the columns to filter the grid's data based on user input.- **Sorting**: LaraGrid supports sorting of data based on any column. It also provides support for sorting data based on a related model's field using PowerJoins.- **Pagination**: The package integrates with Laravel's pagination system, allowing you to easily paginate the data in the grid.- **Customizable Appearance**: LaraGrid allows you to customize the appearance of the grid by extending the `BaseLaraGridTheme` class and setting the desired CSS classes.- **Livewire Integration**: LaraGrid is built with Livewire, a full-stack framework for Laravel that makes building dynamic interfaces simple, without leaving the comfort of Laravel.The package is currently in development and is not ready for use in production. It requires PHP 8.1 or higher and Laravel 10.0 or higher.
License MIT
Informations about the package laragrid
LaraGrid
🚧 This package is in development, and is not ready for use in production yet. 🚧
LaraGrid is a Laravel package that provides a powerful and customizable grid system. It allows you to easily create sortable, filterable tables with pagination.
Table of Contents
- Requirements
- Installation
- Publishable Assets
- Documentation
- Usage
- Creating a Grid
- Displaying the Grid
- Customizing the Theme
- Contribution Guidelines
- Changelog
- License
- Contact Information
- Acknowledgments
Requirements
- PHP 8.1 or higher
- Laravel 10.0 or higher
Installation
To install LaraGrid, you need to run the following command:
Publishable
You can publish the package's configuration, language files, and views using the following commands:
required
optional
TODO List
- [ ] Write tests for all functionality
Base Usage
Creating a Grid
To create a grid, you need to extend the BaseLaraGrid class and implement
the getColumns, and getDataSource methods.
In the getColumns method, you define the columns that will be displayed in the grid. The Column::make method takes
two arguments: the model field and the label.
The getDataSource method should return an instance of Illuminate\Database\Eloquent\Builder for the model you want to
display in the grid.
Displaying the Grid
To display the grid in a Blade view, you can use the @livewire or <livewire> directive:
Replace 'my-grid' with the actual name of your Livewire component.
Customizing the Theme
You can customize the appearance of the grid by extending the BaseLaraGridTheme class and setting the desired CSS.
Then, in your grid class, you need to override the getTheme method and return an instance of your theme class.
By default, there is a theme called TailwindTheme.
Show filtering and sorting in url
If you want to show filtering and sorting in url, you need to rewrite default LaraGrid properties. You can do it like this:
Those Url params are default from livewire, so you can customize them as you want by following livewire docs.
Contribution Guidelines
We welcome contributions to LaraGrid. If you'd like to contribute, please fork the repository, make your changes, and submit a pull request. We have a few requirements for contributions:
- Follow the PSR-2 coding standard.
- Write tests for new features and bug fixes.
- Only use pull requests for contributions.
Changelog
For a detailed history of changes, see releases on GitHub.
License
This project is licensed under the MIT license.
Contact Information
For any questions or concerns, please feel free to create a discussion on GitHub.
Credits
Created by Matěj Černý from Bored Programmers.
Acknowledgments
We would like to thank all the contributors who have helped to make LaraGrid a better package.
All versions of laragrid with dependencies
laravel/framework Version ^10.0
livewire/livewire Version ^3.0