Please Look details not only view. every comment got answer please comment please.
If you dont know answer why. please write I dont know please…
make.blade.php
<html>
<head>
<title>Livewire with select 2 but not working</title>
// please look and comment I need help no one give any answer here.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
```
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/select2-bootstrap-theme/0.1.0-beta.10/select2-bootstrap.min.css" integrity="sha256-nbyata2PJRjImhByQzik2ot6gSHSU4Cqdz5bNYL2zcU=" crossorigin="anonymous" />
@livewireStyles
</head>
<body>
@livewire('select-items')
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
@stack('scripts')
@livewireScripts
</body>
</html>
//// livewire file name select-items
<div>
<div class="container">
<div class="row">
<div class="col-md-4">
<div class="form-group" >
<label for="FirstSelect" class="text-danger">First Select*</label>
<select class="form-control select2" style="width: 100%;" id="FirstSelect" wire:change="firstselect">
<option></option>
<option value="1">One</option>
<option value="2">Two</option>
</select>
</div>
</div>
@if($firstselect)
<div class="col-md-4">
<div class="form-group" >
<label for="SecondSelect" class="text-danger">Second Select*</label>
<select class="form-control select2" style="width: 100%;" id="secondselect" wire:change="secondselect">
<option></option>
<option value="1">One</option>
<option value="2">Two</option>
</select>
</div>
</div>
@endif
</div>
@if($secondselect)
<table>
<tr>
<th>name</th>
<th>address</th>
</tr>
<tr>
<td>Santosh Neupane</td>
<td>From Nepal Need help</td>
</tr>
</table>
@endif
</div>
@push('scripts')
<script>
$(document).ready(function() {
$('.select2').select2({
placeholder: '{{__('Select your option')}}',
allowClear: true
});
});
</script>
@endpush
</div>
//////////////// Livewire Controller
class SelectItems extends Component
{
public $firstselect=null;
public $secondselect=null;
//public $count;
public function render()
{
......... cont.......
Livewire not working why??? and also select2 also not working why??? what is the reasons …
Please not only view please comment. what is the reasons…
If you dont know then please comment also I dont know. dont leave with out comment. Every comment will take one answer and its helps to learner like me who is beginners.
Steps to Reproduce:
Are you using the latest version of Livewire: 1.0
Do you have any screenshots or code examples: