Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Nov 19, 2024
1 parent 7a3ef41 commit 39713c9
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ $group = Fieldset::make(__('Billing Fields'), 'billing')
->withFields(static function (): array {
return [
Text::make(__('Name'), 'billing_name'),
Email::make(__('Email', 'billing_email')),
Email::make(__('Email'), 'billing_email'),
];
});
```
Expand Down Expand Up @@ -434,7 +434,7 @@ $field = Slug::make(__('Slug'), 'slug')
->from(['name']);
```

You may also want to have unique slugs, which means when a slug is already exists in the databse table, the new slug will get an incremented numeric suffix to avoid conflicts:
You may also want to have unique slugs, which means when a slug is already exists in the database table, the new slug will get an incremented numeric suffix to avoid conflicts:

```php
$field->unique();
Expand Down Expand Up @@ -524,7 +524,7 @@ Relation fields are representing Eloquent relation definitions on the resource m

### Configuration

### Searchable & Sortable Columns
#### Searchable & Sortable Columns

#### Customizing the Query

Expand Down Expand Up @@ -554,6 +554,20 @@ $field->withRelatableQuery(function (Request $request, Builder $query, Model $mo

#### Formatting

You may format the relatable models. By default the ID is displayed, but you can customize the format easily:

```php
$field->display('name');
```

Alternatively, you may pass a `Closure` to have an apply formatting logic:

```php
$field->display(static function (Model $model): string {
return strtoupper($model->name);
});
```

#### Aggregates

#### Grouping
Expand Down

0 comments on commit 39713c9

Please sign in to comment.