Skip to content

Commit 7e0914a

Browse files
author
Tortue Torche
committed
Replace Illuminate\Database\Eloquent\Collection by Illuminate\Support\Collection to support collection of Laravel's Paginator.
So you can do in your Controller : $articles = Article::paginate(5); And in your 'app/views/articles/index.blade.php': @div_for($articles->getCollection()) as($article) {{ $article->name }} @end_div_for More info about pagination with Laravel: http://laravel.com/docs/4.2/pagination
1 parent 60aa832 commit 7e0914a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Efficiently/JqueryLaravel/BladeExtensions.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ public function registerContentTags()
104104
$replacement = <<<EOT
105105
<?php
106106
\${$recordName}Record = $record;
107-
if (! is_a(\${$recordName}Record, "\Illuminate\Database\Eloquent\Collection")) {
108-
\${$recordName}Record = new \Illuminate\Database\Eloquent\Collection([\${$recordName}Record]);
107+
if (! is_a(\${$recordName}Record, "\Illuminate\Support\Collection")) {
108+
\${$recordName}Record = new \Illuminate\Support\Collection([\${$recordName}Record]);
109109
}
110110
\${$recordIndex} = -1;// -1 because we increment index at the beginnning of the loop
111111
\${$recordName}Record->each(function(\${$recordName}) use(\$__env, &\${$recordIndex}){

0 commit comments

Comments
 (0)