omnia-digital / livewire-calendar

Laravel Livewire component to show Events in a good looking monthly calendar
MIT License
68 stars 7 forks source link

Calendar doesn't display #16

Closed Critter closed 5 months ago

Critter commented 5 months ago

Just using the values from the readme, I get no errors, but nothing displays either. Any suggestions on where to start looking?

joshtorres commented 5 months ago

Did you add the component to a specific view? If you added the component and still get nothing, I would add https://github.com/barryvdh/laravel-debugbar and see if you can figure out what is happening there or check the laravel logs. image

ndynamite commented 5 months ago

It's really strange. I'm getting the exact same thing.

There are no errors, and nothing reported in Telescope. The livewireScripts and livewireCalendarScripts are included fine.

It seems like its an issue that has occurred for other users before:

Here: https://github.com/asantibanez/livewire-calendar/issues/31

And here: https://github.com/omnia-digital/livewire-calendar/issues/12

I just can't figure it out at all.

@Critter did you manage to find a solution?

joshtorres commented 5 months ago

oh you're right, thanks for reminding me of that. So it looks like in that instance he made a child component of LivewireCalendar and then never called the parent::render(). So you can render your own child component in 2 ways:

Let me know if that helps

Critter commented 5 months ago

@joshtorres I'm still quite new to Laravel, and still not able to suss it out. If I use the code above, I throw an error:

Property [$id] not found on component: [appointments-calendar]

on 'componentId' => $this->id,

joshtorres commented 5 months ago

@Critter ok thanks for pointing that out. It looks like the new version of livewire is using a different way of retrieving the component Id. I just updated the LivewireCalendar component so now it should work with either version of livewire. Note: you will need to run composer update to get the new version of the package. Also, you don't have to have the render() method at all in your child AppointmentsCalendar component. It could look similar to this: image

Critter commented 5 months ago

@joshtorres perfect! that did it. I appreciate you taking the time to explain it.

/cc @ndynamite this sorted it.

joshtorres commented 5 months ago

No problem @Critter . I'm glad I could help :D

Critter commented 5 months ago

@joshtorres Dude. that debug bar is some shit! Thanks for that also. 🙏🏻

joshtorres commented 3 months ago

No problem! Yeah Debugbar is amazing!