Php laravel:多选择查询

Php laravel:多选择查询,php,laravel,Php,Laravel,我理解执行select查询是非常困难的 $bearLawly = Bear::where('name', '=', 'Lawly')->first(); 但是如何执行选择查询,例如 SELECT * FROM bear where name = 'abc' AND age => '5' AND title = 'kid' ORDER BY name LIMIT 5, 10 谢谢 只需将它们链接起来: $bearLawly = Bear::where('name', 'Lawly'

我理解执行select查询是非常困难的

$bearLawly = Bear::where('name', '=', 'Lawly')->first();
但是如何执行选择查询,例如

SELECT * FROM bear where name = 'abc' AND age => '5' AND title = 'kid' ORDER BY name LIMIT 5, 10
谢谢

只需将它们链接起来:

$bearLawly = Bear::where('name', 'Lawly')->where('age', '5')->first();
你可以试试这个:

$bearLawly = Bear::where('name', 'abc') // By default = will be used, so optional
                 ->where('age', '>=', '5')
                 ->where('title', 'kid')
                 ->orderBy('name') // or orderBy('name', 'desc') for reverse
                 ->take(5)->skip(10)->get();
根据以下查询:

SELECT * FROM bear where name = 'abc' AND age => '5' AND title = 'kid' ORDER BY name LIMIT 5, 10

如果我不希望只找到第一个,而是“按名称订购限制5,10”呢?