我最近在laravel編碼,但我遇到了一些我不太瞭解的東西,我怎麼能用laravel爲以下代碼運行multiple where子句查詢?Laravel多與3 if語句在哪裏?
@if ($businesses->where('business_owner_id', '=', Auth::user()->id)->where('business_status', '=', 'accepted')->count() > 0)
You own a business...
@elseif ($businesses->where('business_owner_id', '=', Auth::user()->id)->where('business_status', '=', 'pending')->count() > 0)
You have a business, but it is currently pending.
@else
<p>You can apply to create your own business by clicking the button below.</p>
<a href="/business/create"><div class="btn btn-default">Create a business</div></a>
@endif
錯誤:解析錯誤:語法錯誤,意外 ')'
如何通過$企業?
Cache::remember('overview.businesses', 1, function() {
return Businesses::get();
});
return view('frontend.business.overview')->withBusinesses(Cache::get('overview.businesses'));
這裏有什麼錯誤? –
我已更新我的問題。 –
你在哪一行得到錯誤? –