Skip to content

Gated Response Fields

Choose a tag to compare

@phpsa phpsa released this 19 Jan 22:22
· 8 commits to 3.x since this release
7478119

Example implementations

//Controller
protected $resourceModel = MyClass::class;
protected $resourceSingle = MyClassResource::class;
...
// this used to require the ID and casts where INT based. (some keys may be string based)
// passing the route param is also better long term as is more laravelEsq
public function show(MyClass $record) {
    return $this->handleShowAction($record);
}

//MyClassResource

protected static array $fieldGates = [
    'gate_name' => [
        'field 1',
        'field 2',
     ],
     'gate_two' => [
       'field 3,
     ]
];