Skip to content

Commit 74099f3

Browse files
author
Backstage
committed
fix: check if tables already exist
1 parent 93a5916 commit 74099f3

File tree

2 files changed

+0
-38
lines changed

2 files changed

+0
-38
lines changed

README.md

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -478,33 +478,6 @@ To register your own fields, you can add them to the `fields.fields` config arra
478478
'custom_fields' => [
479479
App\Fields\CustomField::class,
480480
],
481-
482-
### Value Hydration
483-
484-
The `hydrate` method allows you to transform the raw value stored in the database into a runtime representation. This is useful when you want to convert stored IDs into models, format dates, or process JSON data into specific objects.
485-
486-
To use this feature, your field class must implement the `Backstage\Fields\Contracts\HydratesValues` interface.
487-
488-
```php
489-
use Backstage\Fields\Fields\Base;
490-
use Backstage\Fields\Contracts\HydratesValues;
491-
use Illuminate\Database\Eloquent\Model;
492-
493-
class MyCustomField extends Base implements HydratesValues
494-
{
495-
/**
496-
* Hydrate the raw field value into its runtime representation.
497-
*/
498-
public function hydrate(mixed $value, ?Model $model = null): mixed
499-
{
500-
// Transform the raw value
501-
// For example, convert a stored ID to a model instance
502-
return MyModel::find($value);
503-
}
504-
}
505-
```
506-
507-
The `hydrate` method is automatically called when accessing the value of the field.
508481
```
509482

510483
## Documentation

src/Contracts/HydratesValues.php

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)