kczmr
9 months ago

Defining Eloquent function return type

Posted 9 months ago by kczmr

Hi guys,

what do you think about declaring return function types in Eloquent models?

F.e:

class User extends Model
{
    public function getFirstNameAttribute($value): string
    {
        return ucfirst($value);
    }
}

Please sign in or create an account to participate in this conversation.