muzafferdede
7 months ago
1088
4
General

Any difference between defining relationships with 'App\Model' and Model::class

Posted 7 months ago by muzafferdede

I would like to know benefits or reasons when defining relationships or any other class reference definitions. For example

between

    public function profile()
    {
        return $this->belongsTo('App\Profile');
    }

and

    public function profile()
    {
        return $this->belongsTo(Profile::class);
    }

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