- How do I install Laracrate in a Laravel app?
- Install Laracrate with Composer using composer require edulazaro/laracrate. Then publish the package configuration and migrations as shown in the README, configure your R2 or S3 disk credentials, and run php artisan migrate. The service provider is auto-discovered in standard Laravel installations.
- Which Laravel versions does Laracrate support?
- Laracrate is built for modern Laravel applications and relies on Laravel's filesystem, Eloquent, and queue components. Check the require block in composer.json for the exact illuminate/support constraint before upgrading a major Laravel version. The package follows Laravel conventions so it should feel native in supported releases.
- How does Laracrate handle direct uploads to S3 or R2?
- Direct uploads let the browser send files straight to your R2 or S3 bucket using signed URLs, so large files never pass through your Laravel server. You configure bucket credentials, CORS rules, and the allowed disk in the Laracrate config. After the upload completes, Laracrate records the file metadata and can trigger processing pipelines.
- Can I attach files to multiple models with Laracrate?
- Yes. Laracrate uses polymorphic relationships, so a single file record can be attached to users, posts, products, or any other Eloquent model. You add the package's trait to the models that own files and use the provided relationship methods. This keeps one storage table instead of separate tables per model.
- How do processing pipelines work in Laracrate?
- Processing pipelines are configurable chains of steps that run after a file is uploaded, such as image resizing, thumbnail generation, or metadata extraction. They are typically dispatched to Laravel queues so uploads stay fast. You define pipelines per collection or model and can customize each step.
- How do I control who can access uploaded files?
- Laracrate provides access control around stored files, including private bucket support and signed temporary URLs. You authorize users through Laravel policies or gates before issuing a URL. This prevents public exposure of files that should only be available to specific users or roles.
- What is hybrid search in Laracrate and how do I use it?
- Hybrid search in Laracrate combines structured metadata filters with broader search over file records, depending on how you configure it. You can query files by owner, model type, MIME type, tags, or other metadata while also using search-friendly fields. Check the README for the exact search driver and indexing setup.
- How do I test file uploads with Laracrate?
- Use Laravel's Storage::fake and Queue::fake helpers to avoid touching real buckets or queues in tests. Assert that file records are created and that pipeline jobs are dispatched after upload. For direct upload flows, simulate the signed URL request and completion callback in a feature test.
- Is Laracrate suitable for production workloads?
- Laracrate is designed for production use with direct-to-bucket uploads, queued processing, and access-controlled downloads. You should run queue workers, configure private buckets and CORS correctly, and monitor failed pipeline jobs. As with any Composer package, review its release history and test it in staging before deploying.
- What are alternatives to Laracrate for Laravel file storage?
- Common alternatives include Spatie's Laravel Media Library and custom Flysystem integrations. Laracrate differentiates itself with direct R2/S3 uploads, processing pipelines, access control, and hybrid search in one package. Evaluate it if you want those features without assembling several separate packages.