Dmi3yy
05/19/2021, 10:58 AMifox
05/19/2021, 11:24 AMifox
05/19/2021, 11:25 AMifox
05/19/2021, 11:25 AMDmi3yy
05/19/2021, 11:26 AMDmi3yy
05/19/2021, 5:53 PMDmi3yy
05/19/2021, 5:54 PMantonioribeiro
05/19/2021, 5:55 PMprotected $indexOptions = [ 'duplicate' => true ];
?Dmi3yy
05/19/2021, 5:57 PMDmi3yy
05/19/2021, 5:57 PMantonioribeiro
05/19/2021, 5:57 PMDmi3yy
05/19/2021, 5:57 PMDmi3yy
05/19/2021, 5:58 PMantonioribeiro
05/19/2021, 5:58 PMDmi3yy
05/19/2021, 6:07 PMDmi3yy
05/19/2021, 6:19 PM'category' => [
'title' => 'Категория',
'sort' => true,
'relationship' => 'category',
'field' => 'title',
'visible' => true,
],
in debugbar i see info:
https://tppr.me/P1QIi
and inside all ok https://tppr.me/rRCA4Dmi3yy
05/19/2021, 6:20 PMRayderxx
05/19/2021, 6:24 PMRayderxx
05/19/2021, 6:24 PMifox
05/19/2021, 6:25 PMDmi3yy
05/19/2021, 6:27 PMDmi3yy
05/19/2021, 6:30 PMpublic function categories()
{
return $this->belongsToMany(\App\Models\Category::class);
}
Rayderxx
05/19/2021, 6:31 PMRayderxx
05/19/2021, 6:31 PMifox
05/19/2021, 6:32 PMDmi3yy
05/19/2021, 6:33 PM'presenterMethodField' => [ // presenter column
'title' => 'Field title',
'field' => 'presenterMethod',
'present' => true,
]
and add presenterMethod method to model?Rayderxx
05/19/2021, 6:34 PMRayderxx
05/19/2021, 6:35 PMRayderxx
05/19/2021, 6:40 PM<?php
namespace App\Models\Presenters;
class JobPresenter
{
protected $entity;
public function __construct($entity)
{
$this->entity = $entity;
}
public function __get($property)
{
if (method_exists($this, $property)) {
return $this->{$property}();
}
return $this->entity->{$property};
}
public function sectors()
{
return $this->entity->sectors->implode('title', '<br/>');
}
}