When a resource is generated, it will contain an ID field to begin with. You may use any of the fields below by adding them to the fields' method inside your generated resource.
BelongsToDateTimeIDMorphToManyPasswordTextTextarea
<?php
use Itsjeffro\Panel\Fields\ID;
use Itsjeffro\Panel\Fields\Text;
public function fields(): array
{
return [
ID::make(),
Text::make('Title'),
];
}showOnIndex()showOnDisplay()showOnCreate()showOnUpdate()hideOnIndex()hideOnDisplay()hideOnCreate()hideOnUpdate()
use Itsjeffro\Panel\Fields\BelongsTo;
BelongsTo::make('User'),use Itsjeffro\Panel\Fields\MorphToMany;
MorphToMany::make('Roles'),use Itsjeffro\Panel\Fields\HasMany;
HasMany::make('Posts'),Using the Block class can help group fields so that it's easier to view many fields on the page.
use Itsjeffro\Panel\Block;
use Itsjeffro\Panel\Fields\DateTime;
use Itsjeffro\Panel\Fields\ID;
public function fields(): array
{
return [
ID::make(),
new Block('Timestamps', [
DateTime::make('Created At')->hideFromCreate()->hideFromUpdate(),
DateTime::make('Updated At')->hideFromCreate()->hideFromUpdate(),
])
];
}