Closed JibrilYasin closed 6 years ago
The version I use is also laravel 5.4. Look at the namespace use ThinkMe\Pagination\Paginator;
in views
index.blade.php
common/paginate.blade.php
{!!$list->render('common.paginate')!!} or {!!$list->links('common.paginate')!!}
Where is your paging template?
Hi,, this is my view
{!! $pagination !!}
a paging template paginate.blade.php
paginate.blade.php
@if ($paginator->lastPage() > 1)
@endif
$list->render('paginate') or $list->links('paginate')
i use,, $list->links('paginate'),,
Yeahh now work, but in the url there is no parameter like "/2 or/3",, Just http://localhost/laravel/5.4/back-users?page=2
use ThinkMe\Pagination\Paginator;
$list = new Paginator();
$query = Order::select();
$list->route('list.page')->pagesProximity(3)->paginate($query, 10);
dd($list->appends(request()->all())->links('paginate'));
route.php
Route::get('user/{page}', ['as' => 'list.page', 'uses' => 'IndexController@index']);
The result
HtmlString {#65 ▼
}
yeaah,, solved,, I forgot to add the parameters on the route. thanks @ThinkMe
Route::get('/back-users/{page?}'
Hi @ThinkMe ,, sorry,, Can you help me? I get an error on laravel 5.4.
ErrorException Declaration of App\Paginator::links() should be compatible with Illuminate\Pagination\LengthAwarePaginator::links($view = NULL, $data = Array)
This is my Controller <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request; use Illuminate\Support\Facades\DB;
use App\Http\Requests; use App\Services\Date; use App\Services\Code; use JavaScript; use Session; use Image; use File; use App\User; use Auth; use Mail; use Hash; use DateTime; use App\Paginator;
class UserController extends Controller {
}
}
Thanks for attention..