I\'ve got this in my Laravel webapp:
@foreach($mentors as $mentor) @foreach($mentor->intern as $intern) 7条回答 Happy的楠姐 (楼主) 2020-12-08 00:34 Starting from Laravel 5.3 you can simply use : if ($mentor->isNotEmpty()) { //do something. } Documentation https://laravel.com/docs/5.5/collections#method-isnotempty 0 讨论(0) 查看其它7个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复 热议问题
Starting from Laravel 5.3 you can simply use :
if ($mentor->isNotEmpty()) { //do something. }
Documentation https://laravel.com/docs/5.5/collections#method-isnotempty