Hi,
i have a proble regarding scope
I have a A Model that related to B Model.
this is the code of my model A
public $hasMany = [
'emails' => ['Author\Plugin\Models\BModel', 'scope' => 'isEmail']
];
My B model have this function
public function scopeIsEmail($query){
return $query->where('field_type','=','email');
}
The problem is it still get all record even. I just want that all email field must be showned.
Last updated