d

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore.

15 St Margarets, NY 10033
(+381) 11 123 4567
ouroffice@aware.com

 

KMF

Laravel Livewire Calendar Component | Laravel News

Laravel Livewire Calendar is a component by Andrés Santibáñez to show events in a good looking monthly calendar.

Livewire Calendar UI preview

To get started with this component, you’ll create a component that extends the LivewireCalendar class and override the events() method:

1public function events(): Collection

2{

3 return Model::query()

4 ->whereDate('scheduled_at', '>=', $this->gridStartsAt)

5 ->whereDate('scheduled_at', '<=', $this->gridEndsAt)

6 ->get()

7 ->map(function (Model $model) {

8 return [

9 'id' => $model->id,

10 'title' => $model->title,

11 'description' => $model->notes,

12 'date' => $model->scheduled_at,

13 ];

14 });

15}

Next, you need to include your component in any view as you would any Livewire component:

1<livewire:appointments-calendar/>

2 

3{{-- Specify year and month --}}

4<livewire:appointments-calendar

5 year="2019"

6 month="12"

7/>

This component also provides more advanced UI customization. Check out the readme for advanced customization. You can learn more about this package, get full installation instructions, and view the source code on GitHub.

Credit: Source link

Previous Next
Close
Test Caption
Test Description goes like this