ProvincesController::getByRegion()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Yajra\Address\Controllers;
4
5
use Illuminate\Routing\Controller;
6
use Yajra\Address\Repositories\Provinces\ProvincesRepository;
7
8
class ProvincesController extends Controller
9
{
10
    /**
11
     * @var ProvincesRepository
12
     */
13
    protected $repository;
14
15
    /**
16
     * ProvincesController constructor.
17
     *
18
     * @param ProvincesRepository $repository
19
     */
20
    public function __construct(ProvincesRepository $repository)
21
    {
22
        $this->repository = $repository;
23
    }
24
25
    /**
26
     * Get all provinces.
27
     *
28
     * @return \Illuminate\Database\Eloquent\Collection
29
     */
30
    public function all()
31
    {
32
        return $this->repository->all();
33
    }
34
35
    /**
36
     * Get province by region Id.
37
     *
38
     * @param string $regionId
39
     * @return \Illuminate\Database\Eloquent\Collection
40
     */
41
    public function getByRegion($regionId)
42
    {
43
        return $this->repository->getProvinceByRegion($regionId);
44
    }
45
}
46