App\Repositories\Backend\History\EloquentHistoryRepository::renderEntity PHP Method

renderEntity() public method

public renderEntity ( $type, $entity_id, null $limit = null, boolean $paginate = true, integer $pagination = 10 ) : string | Symfony\Component\Translation\TranslatorInterface
$type
$entity_id
$limit null
$paginate boolean
$pagination integer
return string | Symfony\Component\Translation\TranslatorInterface
    public function renderEntity($type, $entity_id, $limit = null, $paginate = true, $pagination = 10)
    {
        $history = History::with('user', 'type')->where('entity_id', $entity_id);
        $history = $this->checkType($history, $type);
        $history = $this->buildPagination($history, $limit, $paginate, $pagination);
        if (!$history->count()) {
            return trans("history.backend.none_for_entity", ['entity' => $type]);
        }
        return $this->buildList($history, $paginate);
    }