Completed
Push — Codacy-Fixes ( c36731...91d4f5 )
by Shawn
02:21
created

Travels::getList()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
3
namespace SET\Handlers\Calendar;
4
5
use Illuminate\Database\Eloquent\Collection;
6
use SET\Travel;
7
8
class Travels extends CollectionList
9
{
10
11
    public function getList() : Collection
12
    {
13
        return Travel::with('user')
14
            ->where(function ($query) {
15
                $query->whereBetween('leave_date', [$this->start, $this->end])
16
                    ->orWhereBetween('return_date', [$this->start, $this->end]);
17
            })
18
            ->get();
19
    }
20
}