Adding Resources
/* Create new model */
'post' => [
/* Security configurations */
'security' => [
'policy' => 'create',
'gate' => 'admin'
]
/* Generators are responsible for instantiation of a fresh model */
'generator' => Generator::class,
/* Modifier is used immediate before save */
'modifier' => Modifier::class,
/* Resource to return - if we want to return a resource/transformed instance of this model after creation */
'resource' => Resource::class,
/* What fields shall we either explicitly populate or explicitly exclude */
'fields' => [
'populate' => ['name', 'email'],
'exclude' => ['password']
],
/* Fire these events */
'events' => [
EventOne::class
],
/* Validation */
'validator' => ProvidesValidation::class,
],Last updated