Input Masks library for live-controls
- Laravel 9+
- Livewire 2+
- English (en)
- German (de)
- Brazilian Portuguese (pt_BR)
- Install Masks package
composer require live-controls/masks
- Include @livecontrolsMasks() before /head tag
- In case you did publish the configuration file, set local_files to false (This is the default option)
- Run:
npm install imask
- Add to app.js:
import IMask from 'imask';
- Run:
npm run build;
- Run:
php artisan vendor:publish --tag="livecontrols.masks.config";
- Edit config/livecontrols-masks.php:
'local_files' => true, //Set local_files to true
@livewire('livecontrols-currencymask', [
'maskId' => 'someUniqueId',
'maskName' => 'someUniqueName',
'unmaskedId' => 'idforhiddeninput',
'unmaskedName' => 'nameforhiddeninput',
'class' => 'input input-bordered w-full',
'required' => true,
'value' => 'set to something if you want to use it for update',
'currencyString' => 'R$',
'updateCallName' => 'WillBeFiredIfValueGotUpdated'
], key())
To update a value call:
$this->dispatch('update-mask-value-maskId', value: 500);