简体   繁体   中英

Laravel pagination issue with blade template

$contractDetails = Sample::where( 'name', 'LIKE', "%$searchText%" )
->orWhere( 'abbreviation', 'LIKE', "%$searchText%" )
->orWhere( 'description', 'LIKE', "%$searchText%" )
->orWhere( 'pp_summary', 'LIKE', "%$searchText%" )
->paginate($paginationNumber);
echo $contractDetails->links(); 

Here pagination is working fine, but when i try to access the same in blade template ,

$this->layout->content =View::make('search.search',array('contractDetails'=>$contractDetails));

template.blade.php

{{ $contractDetails->links() }}

am getting a error : ErrorException

Call to undefined method Illuminate\Database\Query\Builder::links()

Can anyone help me to fix this issue. Thanks in advance.

The problem is variable overridden, in looping same variable overridden cost the time. Thanks for help me to identify.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM