Question: This is my `employeeshift.js` code and I can't figure out how to do a PHP code in a JavaScript file

This is my code inside the `employeeshift.js` but my `var inorno` is null

```
$(document).ready(function(){

var inorno= "<?php echo json_encode($inOrOut ); ?>";

if(inorno=="0"){

 $('.Sales1').hide();
 }else{
$('.Sales1').show();
} 

});

```

Answer: 
I think the following is a little bit cleaner:

```
<input type="radio" name="geckoHatchling" value="1" @if(old('geckoHatchling')) checked @endif>

<input type="radio" name="geckoHatchling" value="0" @if(!old('geckoHatchling')) checked @endif>

```

`@if` is checking the truthiness of the old value and outputting `checked` in either case.
I have tried the accepted answer's solution, it doesn't work for me, 

I had to use this `{{}}` curly braces (which is blade template's echo) in order to use the conditional statement.

```
<input type="radio" name="geckoHatchling" id="geckoHatchlingYes" value="1" {{(old('geckoHatchling') == '1') ? 'checked' : ''}}>

```