Download the PHP package iamgerwin/nova-infinite-scroll without Composer
On this page you can find all versions of the php package iamgerwin/nova-infinite-scroll. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download iamgerwin/nova-infinite-scroll
More information about iamgerwin/nova-infinite-scroll
Files in iamgerwin/nova-infinite-scroll
Package nova-infinite-scroll
Short Description Seamless infinite scrolling for Laravel Nova 3, 4, and 5 resources with automatic loading, filtering, and theme support
License MIT
Homepage https://github.com/iamgerwin/nova-infinite-scroll
Informations about the package nova-infinite-scroll
Laravel Nova Infinite Scroll
Seamless infinite scrolling for Laravel Nova resources. Automatically loads more records as users scroll, eliminating traditional pagination and providing a smooth, modern browsing experience. Compatible with Nova 3, 4, and 5.
Perfect for resources with many records where traditional pagination feels clunky. Works harmoniously with filters, search, and sorting – everything just works! ✨
Features
- 🚀 Plug & Play: Add one trait and you're done
- 🎯 Smart Loading: Only fetches what's needed, when it's needed
- 🔍 Filter Friendly: Works seamlessly with Nova's filters and search
- 🎨 Theme Aware: Respects Nova's light and dark modes
- ⚡ Performance: Low memory footprint with efficient query building
- 🔧 Highly Configurable: Customize per-resource or globally
- 📱 Touch Optimized: Smooth scrolling on mobile devices
- 🔄 Auto-Reset: Automatically resets on filter/search changes
Requirements
- PHP 8.2 or higher
- Laravel 9.x, 10.x, 11.x, or 12.x
- Laravel Nova 3.x, 4.x, or 5.x
Installation
Install the package via composer:
Optionally, publish the configuration file:
The package automatically registers itself with Nova – no additional setup required!
Quick Start
Basic Usage
Add the HasInfiniteScroll trait to your Nova Resource:
That's it! Your resource now supports infinite scrolling. 🎉
Configuration
The package includes sensible defaults, but you can customize everything via the config file:
Per-Resource Configuration
Override settings for individual resources:
How It Works
Nova Infinite Scroll uses the Intersection Observer API to detect when users scroll near the bottom of the resource table. When triggered:
- Checks State: Ensures not already loading and more records exist
- Fetches Data: Makes an API request for the next batch of records
- Appends Results: Seamlessly adds new records to the existing list
- Repeats: Continues until all records are loaded
The magic happens behind the scenes with Vue.js components that integrate directly with Nova's resource index pages. Filters, search, and sorting automatically reset the infinite scroll state – no manual intervention needed!
Advanced Usage
Conditionally Enable Infinite Scroll
Custom Batch Sizes Based on Context
Exclude Resources Programmatically
In your config/nova-infinite-scroll.php:
Performance Tips
- Optimize Your Queries: Use eager loading to prevent N+1 queries
- Index Database Columns: Ensure frequently filtered/sorted columns are indexed
- Adjust Batch Size: Larger batches = fewer requests, but more data transferred
- Use Threshold Wisely: Lower threshold = earlier loading (smoother UX, more requests)
Troubleshooting
Infinite scroll not working?
- Most Common: Ensure the
HasInfiniteScrolltrait is added to your Resource - Check browser console for JavaScript errors
- If using global mode, verify
nova-infinite-scroll.enabledistruein config - Confirm the resource isn't in
excluded_resources - Clear browser cache and reload the page
Default pagination not working?
If you're experiencing issues with default pagination (clicking "Next" does nothing), ensure you're using the latest version. Versions prior to 1.1.0 had a critical bug that broke pagination for resources without the trait.
Loading indicator doesn't show?
- Check if Nova's default styles are loaded
- Verify JavaScript assets are being served
- Try clearing Nova's compiled assets:
php artisan nova:publish
Performance issues?
- Reduce
per_pagevalue for fewer records per batch - Add database indexes on frequently queried columns
- Consider excluding resources with complex computed fields
Testing
Run the test suite:
Run tests with coverage:
Check code style:
Run static analysis:
Changelog
Please see CHANGELOG for more information on recent changes.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate and adhere to PSR-12 coding standards.
Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
Credits
- Gerwin - Creator and maintainer
- Inspired by Filament Infinite Scroll
- Built with Spatie's Laravel Package Tools
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
Made with ❤️ for the Laravel Nova community
All versions of nova-infinite-scroll with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^9.0|^10.0|^11.0|^12.0