10 months ago

how filter in model file

Posted 10 months ago by haizone

hi i have a model is name "city"

and i have that function:

 public function branches()
         return $this->hasMany('App\Models\Branch')

i have table business has many branches.

now i whant only where in business.rest == 1 to filter that and get only where in business table in rest ==1

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