SHARE
TWEET

BalasResource,php

a guest Jan 28th, 2020 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. namespace App\Http\Resources;
  4.  
  5. use Illuminate\Http\Resources\Json\JsonResource;
  6.  
  7. class BalasResource extends JsonResource
  8. {
  9.     /**
  10.      * Transform the resource into an array.
  11.      *
  12.      * @param  \Illuminate\Http\Request  $request
  13.      * @return array
  14.      */
  15.     public function toArray($request)
  16.     {
  17.         // return parent::toArray($request);
  18.         return [
  19.             'id' => $this->id,
  20.             'reply' => $this->body,
  21.             // 'user' => $this->user->name,
  22.             'created_at' => $this->created_at
  23.         ];
  24.     }
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top