Open dillingham opened 2 years ago
Currently to define index fields or form fields, we have to define a method index() show create edit
index()
show
create
edit
and in those formation methods, we return an array of fields.. which get passed to the frontend via meta()
public function index(): array { return [ Field::make('ID'), Field::make('Title'), Field::make('Created At'), ]; } public function create(): array { return [ Field::make('Title'), ]; }
public function fields(): array { return [ Field::make('ID')->only(['index', 'show']), Field::make('Title'), Field::make('Created At')->except(['create', 'edit']), ]; }
Write a test that asserts fields are included or excluded depending on controller method / route.
Currently to define index fields or form fields, we have to define a method
index()
show
create
edit
and in those formation methods, we return an array of fields.. which get passed to the frontend via meta()
Tests
Write a test that asserts fields are included or excluded depending on controller method / route.