Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kakallatt's avatar

Pass data from Nova Resource to FormField

I created a custom Field in Nova and I want to show a list of category in the view and a checkbox will associate with each category.

I already have a recursive array of the category in my resource file but I don't know how to pass it to FormField?

Here is my code:

Category Resource

$resourceId = $request->route()->parameter('resourceId');
$categories = app(self::$model)->where('id', '!=', $resourceId)->orderBy('position', 'ASC')->get()->toTree();

Thank you for your help!!!

0 likes
0 replies

Please or to participate in this conversation.