我在使用以下代码时遇到了一些麻烦。看起来我已经忘记了在圣诞节休息后如何去拉拉维尔
{{ $portalEntries->append(Input::except('page'))->links() }}
错误异常
Method append does not exist. (View: /home/sites/mydomain.com/resources/views/portal/page.blade.php)
以下是获取变量$portalEntries
public function getEntries($paginate = 20, $deleted = false)
{
$query = PortalEntry::select(DB::raw('portal_entries.*'))
->where('portal_entries.portal_page_id', $this->id)
->orderBy('portal_entries.id', 'desc');
if($deleted) {
$query->where('portal_entries.deleted', 1);
}
else {
$query->where('portal_entries.deleted', 0);
}
if(request()->has('search')) {
$query->join('portal_entries_values', 'portal_entries.id', '=', 'portal_entries_values.portal_entries_id');
$query->where('value', 'like', '%'.request("search").'%');
if(request()->input('search_column', 'all') !== 'all') {
$query->where('portal_entries_values.portal_page_columns_id', request()->input('search_column'));
}
}
return $query->paginate($paginate);
}
答案 0 :(得分:2)
将附加替换为追加。 check this link for details
试试这个
{{ $portalEntries->appends(Input::except('page'))->links() }}