Communities for your favorite technologies. Explore all Collectives
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
The checkbox does not take the value from the database. Help please. Thank you.
edit.blade.php
<div class="form-group"> <input type="checkbox" class="" id="onloan" value="{{ $item->onloan }}"> <label for="onloan">On Loan</label> </div>
checked
input
<input type="checkbox" class="" id="onloan" value="1" {{ $item->onloan == 1 ? 'checked' : '' }}>
You have to use checked property to check of input checkbox element.
Add a comment
<div class="form-group"> <input type="checkbox" class="" id="onloan" value="{{ $item->onloan }}" {{$item->onloan == 1 ? 'checked' : ''}}> <label for="onloan">On Loan</label> </div>
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
checkedproperty ofinputelement.<input type="checkbox" class="" id="onloan" value="1" {{ $item->onloan == 1 ? 'checked' : '' }}>