-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot change url by method withUrl()
, when events are created by generator
#80
Comments
Mhm, I see what you mean. As you can see in the I understand that this is suboptimal and I agree that what you expect to work, should work like that, but currently it doesn't. A fix for now, would be to implement the Let me know! :) |
Hi, yes, urlForResource() works great: protected function urlForResource(NovaResource $resource): string
{
$model = $resource->model();
assert($model instanceof CalendarEvent);
return '/resources/' . Str::plural($model->eventable_type) . '/' . $model->eventable_id;
} but I think it is little unintuitive, when all other data is set in resourceToEvents() method. nova-calendar/src/DataProvider/AbstractCalendarDataProvider.php Lines 293 to 299 in efcafb0
Can we move this logic to Event, and use urlForResource as default url until user set own url? |
Hi, yes, I agree, this needs a little refactoring. I'll leave this issue open until I get around to releasing the improvement so others can find the work-around easily. |
Hello,
In my app I have calendar_events table with all calendar events morphed to many other models.
My generator look like this:
And like you see, there is no option to change url by method
withUrl()
, when events are created by generator. Calendar Event always redirects to CalendarEvent model, instead of my customized URL.The text was updated successfully, but these errors were encountered: