app/Http/Resources/HiddenContentForumRowResource.php
/**
     * Transform the resource into an array.
     *
     * @param Request $request
     * @return array
     */
Transform the resource into an array.
@param Request $request
@return array
Transform the resource into an array . @param Request $request @return array
public function toArray($request): array
    {
        return [
            'id' => $this->id,
            'title' => $this->title,
            'type' => $this->type,
            'url' => $this->type === 'internal' ? '/admin/forum/' . $this->id : getForumLinkByTypeAndSlug($this->type, $this->slug),
            'createdAt' => formatDate($this->created_at),
            'userId' => $this->user->id,
            'userName' => $this->user->name
        ];
    }
public function toArray ( $ request ) : array { return [ 'id' => $ this -> id , 'title' => $ this -> title , 'type' => $ this -> type , 'url' => $ this -> type === 'internal' ? '/admin/forum/' . $ this -> id : getForumLinkByTypeAndSlug ( $ this -> type , $ this -> slug ) , 'createdAt' => formatDate ( $ this -> created_at ) , 'userId' => $ this -> user -> id , 'userName' => $ this -> user -> name ] ; }
Transform the resource into an array.
Transform the resource into an array .