I'm creating a Tool for Laravel Nova 2.0
In my Tool
I want to send a list of stuff to the Vue component:
in the PHP src
for my tool I have a function that generates the "meta", as suggested in the documentation here:
public function stuff() {
$stuff = [];
...
return $this->withMeta(['stuff' => $stuff]);
}
In my NovaServiceProvider.php
I instantiate the tool and call the meta function. i.e.
public function tools()
{
return [
(new Tool())->stuff(),
];
}
However, nothing is passed to the Tool.vue component, (I have spent sometime inspecting it!) i.e.:
mounted() {
console.log(this.stuff); // undefined
},
Issue is discussed here: https://github.com/laravel/nova-issues/issues/761, however note that I am using a Tool
and not a ResourceTool
, or a Card
.
Is this a bug with Tools, or something I'm doing wrong? Is there a workaround?