Total Complexity | 5 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class AlbumService extends CRUDServices |
||
9 | { |
||
10 | /** |
||
11 | * @var Album |
||
12 | */ |
||
13 | protected Album $album; |
||
14 | |||
15 | public function __construct() |
||
16 | { |
||
17 | $this->album = app(Album::class); |
||
18 | |||
19 | $albumId = request()->route('album') ?? request('album_id'); |
||
20 | |||
21 | if ($albumId) { |
||
22 | $this->album = $this->album->resolveRouteBinding($albumId); |
||
23 | } |
||
24 | } |
||
25 | |||
26 | /** |
||
27 | * Retrieves an instance of album. |
||
28 | * |
||
29 | * @return \FaithGen\Gallery\Models\Album |
||
30 | */ |
||
31 | public function getAlbum(): Album |
||
32 | { |
||
33 | return $this->album; |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * Makes a list of fields that you do not want to be sent |
||
38 | * to the create or update methods. |
||
39 | * Its mainly the fields that you do not have in the messages table. |
||
40 | * |
||
41 | * @return array |
||
42 | */ |
||
43 | public function getUnsetFields(): array |
||
46 | } |
||
47 | |||
48 | public function getParentRelationship() |
||
51 | } |
||
52 | } |
||
53 |