In Laravel I am fetching the value from database and based on that adding condition to check checkbox. I am facing issue with laravel checkbox is not getting checked. Tried using following code:
// outputting value from database to input field
{{Form::text('lock_user_role',null,array('class'=>'form-control')) }}
// if lock user value is 1 in database then need to check checkbox
{{Form::checkbox('lock_user_role', 'lock_user_role', 'lock_user_role' === '1' ? true : false)}}
Here is my database column structure:

Here is my column value getting stored:
Here is my actual output shown:
As shown in above image, value is showing 1 but checkbox is not getting checked. Can anyone correct my code ? Thanks


lock_user_role' === '1' ? true : false. That is never going to betrue. When would the string'lock_user_role'ever strictly equal'1'? Never. You're basically callingForm::checkbox('lock_user_role', 'lock_user_role', false)so it should be obvious why it's not being checked.oldhelper, or a reference to a Model instance, likeold('lock_user_role', $user->lock_role_user) == 1 ? true : false