BSIT-Caprock / barangay-system

Barangay Information System for the municipality of Barugo, Leyte.
0 stars 0 forks source link

list residents #87

Closed jmarkfen closed 11 months ago

jmarkfen commented 1 year ago

List residents (the latest record for each resident).

Columns:

Filters:

jmarkfen commented 1 year ago

If you're using an accessor column, you may pass sortable() an array of database columns to sort by:

use Filament\Tables\Columns\TextColumn;

TextColumn::make('full_name')
    ->sortable(['first_name', 'last_name'])
jmarkfen commented 1 year ago

Columns may be searchable by using the text input field in the top right of the table. To make a column searchable, you must use the searchable() method:

use Filament\Tables\Columns\TextColumn;

TextColumn::make('name')
    ->searchable()

searchable

jmarkfen commented 1 year ago

If you're using an accessor column, you may pass searchable() an array of database columns to search within:

use Filament\Tables\Columns\TextColumn;

TextColumn::make('full_name')
    ->searchable(['first_name', 'last_name'])
jmarkfen commented 1 year ago

Customizing the table search field placeholder

You may customize the placeholder in the search field using the searchPlaceholder() method on the $table:

use Filament\Tables\Table;

public static function table(Table $table): Table
{
    return $table
        ->columns([
            // ...
        ])
        ->searchPlaceholder('Search (ID, Name)');
}
jmarkfen commented 1 year ago

Searching individually

You can choose to enable a per-column search input field using the isIndividual parameter:

use Filament\Tables\Columns\TextColumn;

TextColumn::make('name')
    ->searchable(isIndividual: true)

individually-searchable

jmarkfen commented 1 year ago

Adding placeholder text if a column is empty

Sometimes you may want to display placeholder text for columns with an empty state, which is styled as a lighter gray text. This differs from the default value, as the placeholder is always text and not treated as if it were real state.

use Filament\Tables\Columns\TextColumn;

TextColumn::make('description')
    ->placeholder('No description.')

placeholder

jmarkfen commented 1 year ago

Toggling column visibility

Users may hide or show columns themselves in the table. To make a column toggleable, use the toggleable() method:

use Filament\Tables\Columns\TextColumn;

TextColumn::make('email')
    ->toggleable()
jmarkfen commented 1 year ago

Aligning column content

Table columns are aligned to the start (left in LTR interfaces or right in RTL interfaces) by default. You may change the alignment using the alignment() method, and passing it Alignment::Start, Alignment::Center, Alignment::End or Alignment::Justify options:

use Filament\Support\Enums\Alignment;
use Filament\Tables\Columns\TextColumn;

TextColumn::make('email')
    ->alignment(Alignment::End)

alignment

Alternatively, you may use shorthand methods like alignEnd()