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

Products::show()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 14
rs 9.4285
cc 2
eloc 7
nc 2
nop 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