/**
* @extends ModelResource<Category>
*/
class CategoryResource extends ModelResource implements HasImportExportContract
{
use ImportExportConcern;
// ...
}
/**
* @extends ModelResource<Category>
*/
class CategoryResource extends ModelResource implements HasImportExportContract
{
use ImportExportConcern;
// ...
protected function exportFields(): iterable
{
return [
ID::make(),
Position::make(),
Text::make('Name'),
];
}
protected function importFields(): iterable
{
return [
ID::make(),
Text::make('Name'),
];
}
}
public function beforeImportFilling(array $data): array
{
return $data;
}
public function beforeImported(mixed $item): mixed
{
return $item;
}
public function afterImported(mixed $item): mixed
{
return $item;
}