php 如果结果雄辩存在Laravel

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 如果结果雄辩存在Laravel相关的知识,希望对你有一定的参考价值。

When using ->get() you cannot simply use any of the below:
To determine if there are any results you can do any of the following:

if ($result->first()) { } 
if (!$result->isEmpty()) { }
if ($result->count()) { }
if (count($result)) { }

以上是关于php 如果结果雄辩存在Laravel的主要内容,如果未能解决你的问题,请参考以下文章

php Laravel雄辩地创建,更新,删除事件

Laravel 5.6 |雄辩的一对多关系

嘲笑 Laravel 雄辩的水合关系

Laravel:如何设置带有条件的自定义列?

Laravel 和雄辩的返回结果来自多对多关系

如何根据“枚举”列获得分类的 laravel 雄辩结果并在一页中显示?