Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
pad-upe
Commits
ef8c47f5
Commit
ef8c47f5
authored
2 years ago
by
Yuri Resende
Browse files
Options
Download
Email Patches
Plain Diff
Corrigindo paginação nas avaliações
parent
7bbc03e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/Providers/AppServiceProvider.php
+17
-0
app/Providers/AppServiceProvider.php
with
17 additions
and
0 deletions
+17
-0
app/Providers/AppServiceProvider.php
View file @
ef8c47f5
...
...
@@ -4,6 +4,8 @@ namespace App\Providers;
use
Illuminate\Pagination\Paginator
;
use
Illuminate\Support\ServiceProvider
;
use
Illuminate\Support\Collection
;
use
Illuminate\Pagination\LengthAwarePaginator
;
class
AppServiceProvider
extends
ServiceProvider
{
...
...
@@ -26,5 +28,20 @@ class AppServiceProvider extends ServiceProvider
{
Paginator
::
useBootstrap
();
Collection
::
macro
(
'paginate'
,
function
(
$perPage
,
$total
=
null
,
$page
=
null
,
$pageName
=
'page'
):
LengthAwarePaginator
{
$page
=
$page
?:
LengthAwarePaginator
::
resolveCurrentPage
(
$pageName
);
return
new
LengthAwarePaginator
(
$this
->
forPage
(
$page
,
$perPage
)
->
values
(),
$total
?:
$this
->
count
(),
$perPage
,
$page
,
[
'path'
=>
LengthAwarePaginator
::
resolveCurrentPath
(),
'pageName'
=>
$pageName
,
]
);
});
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment