- What Laravel and PHP versions does Sharp support?
- Sharp requires **Laravel 11+** and **PHP 8.3+** for full compatibility. It leverages modern Laravel features like Enums and first-class collections, so older versions (e.g., Laravel 10.x) may need updates or won’t work. Always check the [Sharp documentation](http://sharp.code16.fr/docs) for the latest version requirements.
- Can I use Sharp with existing Eloquent models?
- Yes, Sharp is **data-agnostic** and works seamlessly with Eloquent models. Extend `SharpEntity` to define validation rules, relationships, and custom logic. Example: `class PostEntity extends SharpEntity { public function rules(): array { return ['title' => 'required|string']; } }`. No need to rewrite existing models—just adapt them to Sharp’s conventions.
- Does Sharp require a frontend framework like React or Vue?
- Sharp uses **Inertia.js** to render a clean UI without writing frontend code. You’ll need a JavaScript framework (React, Vue, or Svelte) to handle dynamic interactions, but Sharp provides pre-built UI components via Tailwind CSS. If your project already uses Inertia.js, integration is straightforward; otherwise, budget time for setup.
- How does Sharp handle authentication and permissions?
- Sharp integrates with Laravel’s built-in authentication system and adds **role-based access control (RBAC)** and **2FA support** (TOTP or notification-based). You can define permissions per entity or globally using Sharp’s `can()` methods. For example: `$entity->can('edit', $user)`. Documentation covers customizing roles and policies.
- Can I customize Sharp’s UI without overriding core files?
- Sharp is designed for **zero frontend code** but allows UI customization via **Inertia.js page overrides** or publishing assets with `php artisan vendor:publish --tag=sharp-assets`. You can replace or extend views, styles, or JavaScript without modifying Sharp’s core. The API remains PHP-driven for data logic.
- What search and filtering capabilities does Sharp offer out of the box?
- Sharp provides **built-in search, filtering, and sorting** for entities using Eloquent queries. You can chain filters (e.g., `->where('status', 'published')`) or use Sharp’s `Filter` class for complex logic. For advanced search (e.g., Algolia), Sharp’s API integrates with Laravel Scout or custom solutions while keeping the same UI experience.
- Is Sharp suitable for production-grade CMS projects?
- Sharp is **production-ready** and used in live projects like e-commerce and content-driven websites. It includes features like **validation, commands, and 2FA**, but it’s not a full-fledged CMS like Strapi. For standalone CMS needs, pair it with Laravel’s routing or use Sharp for structured content (e.g., blogs, product catalogs) while keeping other admin panels separate.
- How do I migrate from Laravel 10.x to Laravel 11+ for Sharp?
- Upgrade Laravel to 11.x first, then install Sharp via Composer. Test thoroughly—Sharp’s breaking changes (e.g., PHP 8.3+ features) may require adjustments to existing code. The [Sharp upgrade guide](http://sharp.code16.fr/docs) details Laravel 11-specific changes, like Enums or new collection methods. Audit your models and middleware for compatibility.
- Are there alternatives to Sharp for Laravel CMS development?
- Alternatives include **Nova** (Laravel’s official admin panel), **Filament**, or **Orchid**. Sharp differs by being **code-driven, data-agnostic, and frontend-free**—ideal for developers who want a lightweight, API-first approach. If you need a no-code UI builder, consider **Strapi** or **Directus**, but they’re not Laravel-native. Compare features like validation, search, and auth to pick the best fit.
- How do I handle custom commands or bulk actions in Sharp?
- Sharp supports **custom commands** via the `SharpCommand` class or Laravel’s Artisan. Define actions in your entity (e.g., `public function bulkPublish(): void { ... }`) and trigger them via Sharp’s UI or API. For example, create a command to update all draft posts: `php artisan sharp:command posts publish`. Documentation covers registering and securing custom commands.