Answers for "laravel map the output of the api"

PHP
0

laravel map the output of the api

Booking::select(['booking_date', 'pickup_datetime'])->get()
  ->map(function ($booking) {
      $booking->pickup_datetime = optional($booking->pickup_time)->format('d M Y, h:i A');
      $booking->booking_date = optional($booking->created_at)->format('d M Y, h:i A');
      return $booking;
  });
Posted by: Guest on September-17-2021

Code answers related to "laravel map the output of the api"

Browse Popular Code Answers by Language