diff --git a/README.md b/README.md index 7e35902..e21fc2b 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,51 @@ export default defineComponent({ ``` +#### Laravel Blade + +```php +class ChangelogController +{ + public function __invoke() + { + $changelog = DB::table(config('changelog-commit-for-laravel.table_name')) + ->select('message', 'date') + ->orderBy('date', 'desc') + ->paginate(10); + + // Group by date + $groupedChangelog = $changelog->getCollection()->groupBy('date'); + + return view('changelog', [ + 'groupedChangelog' => $groupedChangelog, + 'pagination' => $changelog // Pass pagination object + ]); + } +} +``` + +```html +
+ @foreach ($groupedChangelog as $date => $items) +

+ {{ \Carbon\Carbon::parse($date)->translatedFormat('l d M Y') }} +

+ + @endforeach + + {{-- Laravel Pagination Links --}} +
+ {{ $pagination->links() }} +
+
+``` + ## Testing ```bash