Installation via Composer
The Rest Generic Class package is installed through Composer, PHP’s dependency manager.Install the package
Run the following command in your Laravel project root:Composer will:
- Download the latest stable version (current: 2.1.8)
- Install all required dependencies
- Register the package with your Laravel application
Installation typically takes 30-60 seconds depending on your network speed and system performance.
Verify auto-discovery
Laravel’s package auto-discovery will automatically register the service provider. Verify the package is installed:You should see output confirming the package version and details:
The service provider
Ronu\RestGenericClass\Core\Providers\RestGenericClassServiceProvider is registered automatically via the extra.laravel.providers section in composer.json.Publish configuration (optional)
Publishing the configuration file is optional but recommended if you want to customize package behavior:This creates
config/rest-generic-class.php in your application with default settings.Service Provider Registration
Automatic Registration
The package uses Laravel’s auto-discovery feature. The service provider is registered automatically through theextra.laravel section in composer.json:
You don’t need to manually add the service provider to
config/app.php. Laravel 5.5+ handles this automatically.Manual Registration (Edge Cases)
If auto-discovery is disabled in your project, manually register the provider inconfig/app.php:
config/app.php
What Gets Installed
When you install the package, you get access to:Core Classes
- BaseModel: Extended Eloquent model with filtering, relations, and hierarchy support
- BaseService: Service layer with CRUD operations, caching, and business logic
- RestController: Controller base class with RESTful endpoints
Additional Features
- Dynamic filtering with complex operators
- Relation eager loading and nested selection
- Hierarchical data listing with parent-child relationships
- Request validation and column validation
- Built-in caching with multiple store support
- Export capabilities (with optional dependencies)
- Permission management integration (with Spatie)
Configuration
- Logging configuration for debugging and monitoring
- Filtering rules and validation settings
- Cache strategy and TTL settings
- Query performance options
Troubleshooting Installation
Composer Memory Issues
If Composer runs out of memory during installation:Version Conflicts
If you encounter dependency conflicts:Check that your Laravel version is 12.0 or higher. Run
php artisan --version to verify.Auto-discovery Not Working
Verify auto-discovery is enabled incomposer.json:
dont-discover array, remove it or register the provider manually.