Welcome Guest, Not a member yet? Register   Sign In
Model with Entity (return type)
#1

(This post was last modified: 07-05-2022, 01:19 AM by ozornick.)

Hello. The model returns a stdClass for the returnType. I would like to have a hint as User class. Is it really possible to do this?


PHP Code:
    protected $returnType = \App\Models\Entity\User::class;

    public function findLast(): stdClass // I have User this
    {
        return $this->builder()
            ->orderBy('id DESC')
            ->get(1)->getRow();
    
Reply


Messages In This Thread
Model with Entity (return type) - by ozornick - 07-05-2022, 01:06 AM
RE: Model with Entity (return type) - by iRedds - 07-05-2022, 07:58 AM
RE: Model with Entity (return type) - by ozornick - 07-05-2022, 08:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB