(07-05-2022, 07:58 AM)iRedds Wrote: ->getFirstRow($this->returnType); instead of ->getRow();
Yes, I know that there is such a possibility. Thought I should automatically determine the entity. For find() findAll() only works. Thus, only the model knows about the class
PHP Code:
protected $returnType = \App\Models\Entity\Settings::class;
public function findLast(): ?Settings
{
return $this->builder()
->orderBy('id DESC')
->get(1)->getCustomRowObject(0, $this->returnType);
}