Movatterモバイル変換


[0]ホーム

URL:


Launch Your Next Project in Minutes! Check out our brand newTailwind Starter Templates - Beautiful, production-ready designs that save you hours of development time →

Rappasoft

Getting Started

Usage

DataTable

Columns

Rows

Sorting

Pagination

Search

Bulk Actions

Filters

Reordering

Secondary Header

Footer

Examples

Misc.

Sponsored

Advanced Usage

Examples

This is the documentation forv2 but the latest version isv4. You can switch versions in the menuon the left/at the top. Check your current version with the following command:

composer show rappasoft/laravel-livewire-tables

Creating Columns

Thecolumns method on your component must return an array of Column objects in the order you wish to see them on the table:

1publicfunctioncolumns():array
2{
3return[
4Column::make('Name'),
5Column::make('Email'),
6];
7}

Setting field names

By default, you only need one parameter which acts as the header of the column, the field which it references will be acquired usingStr::snake.

So if you have:

1publicfunctioncolumns():array
2{
3return[
4Column::make('Name'),// Looks for column `name`
5Column::make('Email'),// Looks for column `email`
6];
7}

Of course, this won't work in every situation, for example if you have an ID column, Str::snake will convert it toi_d which is incorrect. For this situation and any other situation where you want to specify the field name, you can pass it as the second parameter:

1publicfunctioncolumns():array
2{
3return[
4Column::make('ID','id'),
5Column::make('E-mail','email'),
6];
7}

Search

Search packages, blog posts, and snippets

Start searching

Type at least 2 characters to search


[8]ページ先頭

©2009-2025 Movatter.jp