Level 6
Why don't you use bootstrap datatable? it's easy and there's many features.
Good evening,
while this bit on my controller works perfect:
public function info($coleccao_tematica) {
$coleccaoTematica = ColeccaoTematica::where('slug', 'LIKE', $coleccao_tematica)
->withCount('multimedia', 'especie')
->with('multimedia', 'poi', 'vid', 'capa')
->with(['especie' => function ($query) {
$query->paginate(2);
}])
->first();
return view('coleccao_tematica', compact('coleccaoTematica'));
}
On my blade template doing
{{ $coleccaoTematica->especie()->links() }}
doesn't generate the pagination and gives the follwing error:
Call to undefined method Illuminate\Database\Query\Builder::links() (View: /home/vagrant/Code/ecocampus/resources/views/coleccao_tematica.blade.php)
What am I missing? :/
You can't use pagination in eager loading:
$coleccaoTematica = ColeccaoTematica::where('slug', 'LIKE', $coleccao_tematica)
->withCount('multimedia', 'especie')
->with('multimedia', 'poi', 'vid', 'capa')
->first();
{{ $coleccaoTematica->especie()->paginate(2)->links() }}
Please or to participate in this conversation.