| Total Complexity | 11 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class TeamRepository implements TeamRepositoryInterface |
||
| 11 | { |
||
| 12 | // Team Index |
||
| 13 | public function indexTeam() |
||
| 14 | { |
||
| 15 | $teams = config('adminetic.caching', true) |
||
| 16 | ? (Cache::has('teams') ? Cache::get('teams') : Cache::rememberForever('teams', function () { |
||
| 17 | return Team::orderBy('position')->get(); |
||
| 18 | })) |
||
| 19 | : Team::orderBy('position')->get(); |
||
| 20 | |||
| 21 | return compact('teams'); |
||
| 22 | } |
||
| 23 | |||
| 24 | // Team Create |
||
| 25 | public function createTeam() |
||
| 26 | { |
||
| 27 | // |
||
| 28 | } |
||
| 29 | |||
| 30 | // Team Store |
||
| 31 | public function storeTeam(TeamRequest $request) |
||
| 32 | { |
||
| 33 | $team = Team::create($request->validated()); |
||
| 34 | $this->uploadImage($team); |
||
| 35 | } |
||
| 36 | |||
| 37 | // Team Show |
||
| 38 | public function showTeam(Team $team) |
||
| 39 | { |
||
| 40 | return compact('team'); |
||
| 41 | } |
||
| 42 | |||
| 43 | // Team Edit |
||
| 44 | public function editTeam(Team $team) |
||
| 45 | { |
||
| 46 | return compact('team'); |
||
| 47 | } |
||
| 48 | |||
| 49 | // Team Update |
||
| 50 | public function updateTeam(TeamRequest $request, Team $team) |
||
| 54 | } |
||
| 55 | |||
| 56 | // Team Destroy |
||
| 57 | public function destroyTeam(Team $team) |
||
| 58 | { |
||
| 59 | $team->delete(); |
||
| 60 | } |
||
| 61 | |||
| 62 | // Upload Image |
||
| 63 | private function uploadImage(Team $team) |
||
| 69 | } |
||
| 70 | } |
||
| 72 |