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 eae6685 commit 417df1e
Showing 1 changed file with 32 additions and 16 deletions.
48 changes: 32 additions & 16 deletions fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ $field->searchable();
$field->searchable(false);
```

## Available Fields
### Translatable Fields

## Generic Fields

### Boolean

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

### Tag

### Text

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

### URL

### Relation Fields
The `URL` field is typically a handler for `url` model attributes:

```php
$field = URL::make(__('GitHub Profile'), 'gh_profile');
```

## Relation Fields

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

#### BelongsTo
### BelongsTo

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

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

> Root assumes that there is an already defined `author` relation on the Resource Model.
#### BelongsToMany
### BelongsToMany

The `BelongsToMany` field is typically a handler for a `Illuminate\Database\Eloquent\Relations\BelongsToMany` relation:

### HasMany

The `HasMany` field is typically a handler for a `Illuminate\Database\Eloquent\Relations\HasMany` relation:

### HasOne

The `HasOne` field is typically a handler for a `Illuminate\Database\Eloquent\Relations\HasOne` relation:

#### HasMany
### MorphMany

#### HasOne
The `MorphMany` field is typically a handler for a `Illuminate\Database\Eloquent\Relations\MorphMany` relation:

#### MorphMany
### MorphOne

#### MorphOne
The `MorphOne` field is typically a handler for a `Illuminate\Database\Eloquent\Relations\MorphOne` relation:

#### MorphToMany
### MorphToMany

#### File
The `MorphToMany` field is typically a handler for a `Illuminate\Database\Eloquent\Relations\MorphToMany` relation:

The `File` field is typically a handler for `json` model attributes (array of values):
### File

#### Media
### Media

#### Meta
### Meta

### Computed Fields
## Computed Fields

0 comments on commit 417df1e

Please sign in to comment.