Wrapper that helps create options at select element dynamically
michalkortas/laravel-options-creator is a Laravel package for wrapper that helps create options at select element dynamically.
It currently has 2 GitHub stars and 53 downloads on Packagist (latest version v1.0.12).
Install it with composer require michalkortas/laravel-options-creator.
Discover more Laravel packages by michalkortas
or browse all Laravel packages to compare alternatives.
Last updated
Wrapper that helps create options at select element dynamically
Warning! This component use Bootstrap Modal!
composer require michalkortas/laravel-options-creator
php artisan vendor:publish --tag=optionscreator --force
Add new stacks before end of
tag.<body>
...
@stack('scripts')
@stack('optionscreator')
</body>
Wrap your select with new tag. You can use some parameters to configure modal.
<x-optionscreator-select
url="{{route('store.api.route')}}"
component="components.subEditForm"
successValueKey="id"
successTextKey="name"
title="New option"
saveButtonTitle="Create new option"
loadingText="Please wait..."
successText="<strong>New option has beed added</strong> to your select tag."
errorText="<strong>Error occurred</strong>. Check console log."
setNewValue="1">
<select name="mySelect">
<option>Select value</option>
</select>
</x-optionscreator-select>
This component will do the rest.