Calendar.php 459 B

12345678910111213141516171819202122
  1. <?php
  2. namespace App\Http\Livewire;
  3. use Livewire\Component;
  4. class Calendar extends Component
  5. {
  6. public $records;
  7. public function render()
  8. {
  9. $this->records = [];
  10. $calendars = \App\Models\Calendar::get();
  11. foreach($calendars as $c)
  12. {
  13. $this->records[] = array('id' => $c->id, 'title' => $c->course->name, 'start' => $c->from, 'end' => $c->to);
  14. }
  15. return view('livewire.calendar');
  16. }
  17. }