michalkortas/laravel-options-creator
<select> elements via a Bootstrap modal, with minimal backend interaction. It fits well in Laravel applications where dynamic form options (e.g., CRUD forms, filters) are managed client-side without heavy API polling.<x-optionscreator-select>), aligning with Laravel’s modern Blade stack but requiring custom Blade directives or components to be registered.url parameter) for fetching/creating options, making it suitable for applications with existing RESTful endpoints for option management.successValueKey, successTextKey), which may not align with existing APIs.<x-optionscreator-select>?successValueKey, successTextKey)?<select> options are sparingly dynamic (e.g., admin panels, filters) and not performance-critical.composer require michalkortas/laravel-options-creator
php artisan vendor:publish --tag=optionscreator --force
@stack('optionscreator') before </body> in the master layout.<select> elements with the component:
<x-optionscreator-select
url="{{ route('options.store') }}"
component="partials.option-modal"
successValueKey="id"
successTextKey="name"
...
>
<select name="category_id">
<option>Choose...</option>
</select>
</x-optionscreator-select>
POST /api/options) that:
name, value).{ "id": 1, "name": "Option 1" } to match successValueKey/successTextKey.@stack and component syntax; may conflict with custom directives.errorText parameter).localStorage after first load.select2 or custom logic).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Package not compatible with Laravel 10 | Integration fails | Fork and update dependencies |
| Bootstrap/jQuery version mismatch | Modal/AJAX breaks | Downgrade or override package assets |
| API endpoint returns wrong format | Options don’t populate correctly | Validate API response format |
| JavaScript disabled | Select remains static | Provide server-side fallback (e.g., preload options) |
| Network/API failures | Modal shows error but doesn’t recover | Add retry logic or user-friendly fallback |
url, component, and key parameters for the team.successValueKey/successTextKey.How can I help you explore Laravel packages today?