8000 GitHub - codedge/livewire-companion: A Laravel Livewire set of components for building datables and more.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Apr 28, 2020. It is now read-only.

codedge/livewire-companion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latest Stable Version License Total Downloads StyleCI

Livewire Companion

Livewire Companion is a set of components based on Laravel Livewire, to get you quickly up and running for recurring tasks.

Included components

All components use the brilliant Tailwind CSS. 🚀

Currently included components are:

  • Datatable
    • Search over one column
    • Sorting of columns
    • Pagination
    • Indicators for pages and total records
    • Items per page

Datataböe

  • Map (coming soon)

How to install

You can install the package via composer:

$ composer require codedge/livewire-companion

The package will automatically register itself. Then publish the assets (configuration and templates):

$ php artisan vendor:publish --provider="Codedge\LivewireCompanion\LivewireCompanionServiceProvider"

This is going to publish all templates to resources/views/vendor/livewire-companion. Feel free to modify to your needs.

How to use

Datatables

The datatable component support both, Eloquent collections and Support collections.

Create a new file at app/Http/Livewire/MyTable.php:

<?php declare(strict_types=1);
// ...
use Codedge\LivewireCompanion\Components\Datatable;

class MyTable extends Datatable
{
    protected $model = User::class;
    // ...
}

The Livewire component needs to inherit the Datatable class. Then make sure you configure the component as you like:

  • $model: Specify the model class, mandatory
  • $perPageOptions: Available options show items per page, default: 5, 10, 25
  • $searchingEnabled: Enable/Disable searching, default: true
  • $sortingEnabled: Enable/Disable sorting, default: true
  • $template: Overwrite Datatable template path, default: vendor.livewire-companion.datatable

Contributing

If you miss any component or want to extend functionality and/or fixing bugs - feel free to submit a PR. I happily merge it in.

About

A Laravel Livewire set of components for building datables and more.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published
0