Created
September 29, 2022 12:18
-
-
Save humayunjavaid/ed21c713e04034d0d64ceaa74ca540a9 to your computer and use it in GitHub Desktop.
Pickaday Integration with Laravel Livewire And Alpine js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div | |
x-data="{ value : @entangle($attributes->wire('model')) }" | |
x-on:change="value = $event.target.value" | |
x-init=" | |
new Pikaday({ field: $refs.input, 'format': 'MM/DD/YYYY' });" | |
> | |
<div class="relative mt-2"> | |
<input | |
{{ $attributes->whereDoesntStartWith('wire:model') }} | |
x-ref="input" | |
x-bind:value="value" | |
type="text" | |
class="form-control" placeholder="Select date" | |
/> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Component Render */ | |
<x-date-picker | |
wire:model="start_year" | |
id="datepicker" | |
autocomplete="off" | |
/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you so much.