Skip to content

Commit 5b3c23f

Browse files
committed
remove pagination as laravel now supports it
1 parent 447f180 commit 5b3c23f

File tree

7 files changed

+15
-139
lines changed

7 files changed

+15
-139
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,17 @@ Add a new i18n string in the `resources/lang/XX/pagination.php` file for each la
3434
This should help with accessibility
3535
```html
3636
<li>
37-
<a href="URL?page=2" class="..."
37+
<a href="URL?page=2" class="..."
3838
aria-label="Goto page #2"
3939
>
4040
2
4141
</a>
4242
</li>
4343
```
4444

45+
#### Pagination
46+
Laravel now supports tailwindcss pagination, you can refer to [docs](https://laravel.com/docs/master/pagination#using-tailwind).
47+
4548
### Screenshots
4649

4750
![Welcome](/screenshots/welcome.png)
@@ -55,6 +58,3 @@ This should help with accessibility
5558
![Dashboard](/screenshots/dashboard.png)
5659

5760
![Verify](/screenshots/verify.png)
58-
59-
![Pagination](/screenshots/pagination-links.png)
60-
![Simple Pagination](/screenshots/simple-pagination-links.png)

screenshots/pagination-links.png

-1.27 KB
Binary file not shown.
-1.08 KB
Binary file not shown.

src/TailwindCssPreset.php

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ public static function install()
1717
static::updateStyles();
1818
static::updateBootstrapping();
1919
static::updateWelcomePage();
20-
static::updatePagination();
2120
static::removeNodeModules();
2221
}
2322

@@ -50,40 +49,33 @@ protected static function updateStyles()
5049
$filesystem->delete(public_path('js/app.js'));
5150
$filesystem->delete(public_path('css/app.css'));
5251

53-
if (! $filesystem->isDirectory($directory = resource_path('css'))) {
52+
if (!$filesystem->isDirectory($directory = resource_path('css'))) {
5453
$filesystem->makeDirectory($directory, 0755, true);
5554
}
5655
});
5756

58-
copy(__DIR__.'/tailwindcss-stubs/resources/css/app.css', resource_path('css/app.css'));
57+
copy(__DIR__ . '/tailwindcss-stubs/resources/css/app.css', resource_path('css/app.css'));
5958
}
6059

6160
protected static function updateBootstrapping()
6261
{
63-
copy(__DIR__.'/tailwindcss-stubs/tailwind.config.js', base_path('tailwind.config.js'));
62+
copy(__DIR__ . '/tailwindcss-stubs/tailwind.config.js', base_path('tailwind.config.js'));
6463

65-
copy(__DIR__.'/tailwindcss-stubs/webpack.mix.js', base_path('webpack.mix.js'));
64+
copy(__DIR__ . '/tailwindcss-stubs/webpack.mix.js', base_path('webpack.mix.js'));
6665

67-
copy(__DIR__.'/tailwindcss-stubs/resources/js/bootstrap.js', resource_path('js/bootstrap.js'));
68-
}
69-
70-
protected static function updatePagination()
71-
{
72-
(new Filesystem)->delete(resource_path('views/vendor/paginate'));
73-
74-
(new Filesystem)->copyDirectory(__DIR__.'/tailwindcss-stubs/resources/views/vendor/pagination', resource_path('views/vendor/pagination'));
66+
copy(__DIR__ . '/tailwindcss-stubs/resources/js/bootstrap.js', resource_path('js/bootstrap.js'));
7567
}
7668

7769
protected static function updateWelcomePage()
7870
{
7971
(new Filesystem)->delete(resource_path('views/welcome.blade.php'));
8072

81-
copy(__DIR__.'/tailwindcss-stubs/resources/views/welcome.blade.php', resource_path('views/welcome.blade.php'));
73+
copy(__DIR__ . '/tailwindcss-stubs/resources/views/welcome.blade.php', resource_path('views/welcome.blade.php'));
8274
}
8375

8476
protected static function scaffoldController()
8577
{
86-
if (! is_dir($directory = app_path('Http/Controllers/Auth'))) {
78+
if (!is_dir($directory = app_path('Http/Controllers/Auth'))) {
8779
mkdir($directory, 0755, true);
8880
}
8981

@@ -93,7 +85,7 @@ protected static function scaffoldController()
9385
->each(function (SplFileInfo $file) use ($filesystem) {
9486
$filesystem->copy(
9587
$file->getPathname(),
96-
app_path('Http/Controllers/Auth/'.Str::replaceLast('.stub', '.php', $file->getFilename()))
88+
app_path('Http/Controllers/Auth/' . Str::replaceLast('.stub', '.php', $file->getFilename()))
9789
);
9890
});
9991
}
@@ -109,13 +101,13 @@ protected static function scaffoldAuth()
109101
);
110102

111103
tap(new Filesystem, function ($filesystem) {
112-
$filesystem->copyDirectory(__DIR__.'/tailwindcss-stubs/resources/views', resource_path('views'));
104+
$filesystem->copyDirectory(__DIR__ . '/tailwindcss-stubs/resources/views', resource_path('views'));
113105

114106
collect($filesystem->allFiles(base_path('vendor/laravel/ui/stubs/migrations')))
115107
->each(function (SplFileInfo $file) use ($filesystem) {
116108
$filesystem->copy(
117109
$file->getPathname(),
118-
database_path('migrations/'.$file->getFilename())
110+
database_path('migrations/' . $file->getFilename())
119111
);
120112
});
121113
});
@@ -126,7 +118,7 @@ protected static function compileControllerStub()
126118
return str_replace(
127119
'{{namespace}}',
128120
Container::getInstance()->getNamespace(),
129-
file_get_contents(__DIR__.'/tailwindcss-stubs/controllers/HomeController.stub')
121+
file_get_contents(__DIR__ . '/tailwindcss-stubs/controllers/HomeController.stub')
130122
);
131123
}
132124
}

src/TailwindCssPresetServiceProvider.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace LaravelFrontendPresets\TailwindCssPreset;
44

5-
use Illuminate\Pagination\Paginator;
65
use Illuminate\Support\ServiceProvider;
76
use Laravel\Ui\UiCommand;
87
use Laravel\Ui\AuthCommand;
@@ -24,9 +23,5 @@ public function boot()
2423

2524
$command->comment('Please run "npm install && npm run dev" to compile your fresh scaffolding.');
2625
});
27-
28-
Paginator::defaultView('pagination::default');
29-
30-
Paginator::defaultSimpleView('pagination::simple-default');
3126
}
3227
}

src/tailwindcss-stubs/resources/views/vendor/pagination/default.blade.php

Lines changed: 0 additions & 69 deletions
This file was deleted.

src/tailwindcss-stubs/resources/views/vendor/pagination/simple-default.blade.php

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)