| Total Complexity | 4 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class EventPaymentChart extends Component |
||
| 10 | { |
||
| 11 | public $event; |
||
| 12 | public $payments; |
||
| 13 | public $chart = 1; // 1 = Area | 2 = Bar |
||
| 14 | public $per = 1; // 1 = Day | 2 = Month |
||
| 15 | |||
| 16 | protected $listeners = ['initialize_event_payment_chart' => 'initializeEventPaymentChart']; |
||
| 17 | |||
| 18 | public function mount($event = null) |
||
| 19 | { |
||
| 20 | $this->event = $event; |
||
| 21 | $this->payments = ! is_null($event) ? $event->payments : Payment::orderBy('position')->get(); |
||
| 22 | } |
||
| 23 | |||
| 24 | public function initializeEventPaymentChart() |
||
| 25 | { |
||
| 26 | $payments = $this->payments; |
||
| 27 | $this->dispatchBrowserEvent('initializeEventPaymentChart', (new Statistic)->perDayPaymentTotal($payments)); |
||
| 28 | } |
||
| 29 | |||
| 30 | public function render() |
||
| 33 | } |
||
| 34 | } |
||
| 35 |