Laravel Eloquent with and find

后端 未结 4 1966
孤城傲影
孤城傲影 2020-12-30 18:54

Why is this not working?

Article::with(\'category\')->find($ids)

I got a Array to String Conversion Exception.

But if i split t

4条回答
  •  Happy的楠姐
    2020-12-30 19:48

    This will give you the results based on an array of IDs in Laravel 4

    Article::whereIn('id', $ids)->with('category')->get();
    

提交回复
热议问题