Completed
Push — master ( 91081e...20ce73 )
by Scott
02:47
created

Products   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 25
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A show() 0 14 2
1
<?php namespace Bedard\Shop\Api;
2
3
use Bedard\Shop\Classes\ApiController;
4
use Bedard\Shop\Models\ApiSettings;
5
use Bedard\Shop\Repositories\ProductRepository;
6
use Exception;
7
use Log;
8
9
class Products extends ApiController
10
{
11
12
    /**
13
     * Find a single product.
14
     *
15
     * @param  \Bedard\Shop\Repositories\ProductRepository  $repository
16
     * @param  string                                       $slug
17
     * @return \Bedard\Shop\Models\Product
18
     */
19
    public function show(ProductRepository $repository, $slug)
20
    {
21
        try {
22
            $params = [
23
24
            ];
25
26
            return $repository->find($slug, $params);
27
        } catch (Exception $e) {
28
            Log::error($e->getMessage());
29
30
            abort(500, $e->getMessage());
31
        }
32
    }
33
}
34