Closed aeq-dev closed 2 months ago
in your Activity model in the toResource
method, you need to define an ID for the resource, not pass $this
to the Resource Value Object.
public function toResource(): array | Resource
{
return Resource::make($this->id)
->title($this->name);
}
But thanks for the notice, I'll add to the next release that it will automatically use the primary key if the whole model is passed, to keep it same with the Eventable
API.
In version 1.2.1, passing just $this
to the Resource should work now and it will use the primary key as the ID for the resource.
Thank you so much :))) It works now
Hi @lukas-frey Let's say we have an event model Task which belongs to User & Activity, How could we create two resources view one per User & other per Activity ? Thanks
Never mind, just use resourceIds :)))) Sorry :))))
What feature would you like to add?
I'm trying to setup resources, but cannot display events on each resource (Events created but not displayed under their resources). Here's my setup : Models :
Activity
has manyTask
Task Model :Activity Model :
CalendarWidget :
Notes
No response