| Total Complexity | 9 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class ContactRepository implements ContactRepositoryInterface |
||
| 11 | { |
||
| 12 | // Contact Index |
||
| 13 | public function indexContact() |
||
| 14 | { |
||
| 15 | $contacts = config('coderz.caching', true) |
||
| 16 | ? (Cache::has('contacts') ? Cache::get('contacts') : Cache::rememberForever('contacts', function () { |
||
| 17 | return Contact::latest()->paginate(10); |
||
| 18 | })) |
||
| 19 | : Contact::latest()->paginate(10); |
||
| 20 | return compact('contacts'); |
||
| 21 | } |
||
| 22 | |||
| 23 | // Contact Create |
||
| 24 | public function createContact() |
||
| 25 | { |
||
| 26 | // |
||
| 27 | } |
||
| 28 | |||
| 29 | // Contact Store |
||
| 30 | public function storeContact(ContactRequest $request) |
||
| 31 | { |
||
| 32 | Contact::create($request->validated()); |
||
| 33 | } |
||
| 34 | |||
| 35 | // Contact Show |
||
| 36 | public function showContact(Contact $contact) |
||
| 37 | { |
||
| 38 | return compact('contact'); |
||
| 39 | } |
||
| 40 | |||
| 41 | // Contact Edit |
||
| 42 | public function editContact(Contact $contact) |
||
| 43 | { |
||
| 44 | return compact('contact'); |
||
| 45 | } |
||
| 46 | |||
| 47 | // Contact Update |
||
| 48 | public function updateContact(ContactRequest $request, Contact $contact) |
||
| 51 | } |
||
| 52 | |||
| 53 | // Contact Destroy |
||
| 54 | public function destroyContact(Contact $contact) |
||
| 57 | } |
||
| 58 | } |
||
| 59 |