GeneralSettingCollection.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace App\Http\Resources\V2;
  3. use Illuminate\Http\Resources\Json\ResourceCollection;
  4. class GeneralSettingCollection extends ResourceCollection
  5. {
  6. public function toArray($request)
  7. {
  8. return [
  9. 'data' => $this->collection->map(function($data) {
  10. return [
  11. 'logo' => $data->logo,
  12. 'site_name' => $data->site_name,
  13. 'address' => $data->address,
  14. 'description' => $data->description,
  15. 'phone' => $data->phone,
  16. 'email' => $data->email,
  17. 'facebook' => $data->facebook,
  18. 'twitter' => $data->twitter,
  19. 'instagram' => $data->instagram,
  20. 'youtube' => $data->youtube,
  21. 'google_plus' => $data->google_plus
  22. ];
  23. })
  24. ];
  25. }
  26. public function with($request)
  27. {
  28. return [
  29. 'success' => true,
  30. 'status' => 200
  31. ];
  32. }
  33. }