Skip to content

Commit 417df1e

Browse files
committed
wip
1 parent eae6685 commit 417df1e

File tree

1 file changed

+32
-16
lines changed

1 file changed

+32
-16
lines changed

fields.md

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ $field->searchable();
140140
$field->searchable(false);
141141
```
142142

143-
## Available Fields
143+
### Translatable Fields
144+
145+
## Generic Fields
144146

145147
### Boolean
146148

@@ -469,8 +471,6 @@ By default the `Slug` field is generating slug only when creating the model. If
469471
$field->always();
470472
```
471473

472-
### Tag
473-
474474
### Text
475475

476476
The `Text` field is typically a handler for `string` model attributes:
@@ -512,11 +512,17 @@ $field->cols(100);
512512

513513
### URL
514514

515-
### Relation Fields
515+
The `URL` field is typically a handler for `url` model attributes:
516+
517+
```php
518+
$field = URL::make(__('GitHub Profile'), 'gh_profile');
519+
```
520+
521+
## Relation Fields
516522

517523
Relation fields are representing Eloquent relation definitions on the resource models. Relation fields are highly customizable and provide a nice and detailed API.
518524

519-
#### BelongsTo
525+
### BelongsTo
520526

521527
The `BelongsTo` field is typically a handler for a `Illuminate\Database\Eloquent\Relations\BelongsTo` relation:
522528

@@ -526,24 +532,34 @@ $field = BelongsTo::make(__('Author'), 'author');
526532

527533
> Root assumes that there is an already defined `author` relation on the Resource Model.
528534
529-
#### BelongsToMany
535+
### BelongsToMany
536+
537+
The `BelongsToMany` field is typically a handler for a `Illuminate\Database\Eloquent\Relations\BelongsToMany` relation:
538+
539+
### HasMany
540+
541+
The `HasMany` field is typically a handler for a `Illuminate\Database\Eloquent\Relations\HasMany` relation:
542+
543+
### HasOne
544+
545+
The `HasOne` field is typically a handler for a `Illuminate\Database\Eloquent\Relations\HasOne` relation:
530546

531-
#### HasMany
547+
### MorphMany
532548

533-
#### HasOne
549+
The `MorphMany` field is typically a handler for a `Illuminate\Database\Eloquent\Relations\MorphMany` relation:
534550

535-
#### MorphMany
551+
### MorphOne
536552

537-
#### MorphOne
553+
The `MorphOne` field is typically a handler for a `Illuminate\Database\Eloquent\Relations\MorphOne` relation:
538554

539-
#### MorphToMany
555+
### MorphToMany
540556

541-
#### File
557+
The `MorphToMany` field is typically a handler for a `Illuminate\Database\Eloquent\Relations\MorphToMany` relation:
542558

543-
The `File` field is typically a handler for `json` model attributes (array of values):
559+
### File
544560

545-
#### Media
561+
### Media
546562

547-
#### Meta
563+
### Meta
548564

549-
### Computed Fields
565+
## Computed Fields

0 commit comments

Comments
 (0)