- How do I install laravel-liberu/data-export in a Laravel application?
- Install the package with Composer using composer require laravel-liberu/data-export. Because it is part of the Liberu ecosystem, make sure the required Liberu core packages and UI/auth setup are already configured. Follow the repository README for any configuration publishing, migrations, or service provider steps needed by your Laravel version, then clear your config and cache.
- How do I export an Eloquent model to CSV or Excel with this package?
- Define an export using the package's export class or builder, point it at your Eloquent model or query, and choose the desired columns and output format. Apply any filters before dispatching or running the export. The package then produces a downloadable CSV or Excel file, or a queued export file for larger datasets.
- Can laravel-liberu/data-export handle large exports using queues?
- Yes, the package supports queued exports for large data. Configure a queue connection and run workers in your Laravel application so export jobs can process in the背景 without blocking web requests. For production, monitor failed jobs and storage usage, and make sure generated files are cleaned up according to your retention policy.
- How do I configure which columns are included in a data export?
- Use the package's configurable columns to define the fields, labels, and formatting included in each export. Keep the column list explicit rather than exposing every model attribute, especially for sensitive data. If you use the Liberu UI integration, verify that column visibility and export permissions match your application's authorization rules.
- How does permission-aware integration with the Liberu UI work?
- The package is designed to integrate with Laravel Liberu's UI and permission system so export actions and column access can follow your application's authorization rules. Configure the relevant Liberu roles and permissions, then test exports with different user accounts. Check the package documentation for the exact permission names and UI registration details.
- Can I export filtered queries or custom datasets instead of only Eloquent models?
- Yes, the package is intended for Eloquent models, filtered queries, and custom datasets. Build the query with your filters or map a custom collection into the export structure, then define the columns to output. For joins or aggregate data, use explicit column mappings so the CSV or Excel output stays predictable.
- Which Laravel and PHP versions are supported by laravel-liberu/data-export?
- Check the package's composer.json constraints and the GitHub README for the supported Laravel and PHP versions before installing. Liberu packages generally track modern Laravel releases, but compatibility can change between major versions. If Composer reports a conflict, use composer why-not laravel-liberu/data-export to identify the incompatible dependency.
- How should I test data exports in a Laravel application?
- Use Laravel's testing helpers such as Storage::fake and Queue::fake to avoid writing real files or processing real jobs. Assert that the correct export job is dispatched, that the expected file is generated, and that column values appear correctly. Also test permission-aware behavior with actingAs for users who should and should not be allowed to export.
- What are alternatives to laravel-liberu/data-export?
- Common alternatives include Laravel Excel for broad spreadsheet import and export features, simpler CSV packages, or a custom streamed CSV response for narrow use cases. Choose laravel-liberu/data-export when you are already using Laravel Liberu and want permission-aware UI integration with queued exports. Choose a standalone package when you need advanced spreadsheet features outside the Liberu ecosystem.
- Is laravel-liberu/data-export maintained and suitable for production use?
- It is part of the Laravel Liberu package ecosystem, so review the GitHub releases, open issues, and Composer constraints to judge current maintenance for your version. For production, pin a tested version, run queue workers reliably, and monitor generated files and failed exports. Check the license and security guidance before deploying it in a critical application.