You can't. in Laravel 5 you will have to namespace your classes.
hasOne
does not need a where
. It is a relationship you set so you can enforce what object_type
it is when you generate that relationship.
How to enforce?
What should i write instead of 'where'?
public function html_meta()
{
return $this->hasOne('App\HtmlMeta','object_id','id')->where('object_type','=','2');
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community