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.
befor Laravel 9
---------------

```
<input type"radio" name="active" value="1" {{old('active',user->active))?'checked',''}}/>
<input type"radio" name="active" value="0" {{old('active',user->active))?'','checked'}}/>

```

Laravel 9
---------

```
<input type"radio" name="active" value="1" @checked(old('active',$user->active))/>
<input type"radio" name="active" value="0" @checked(!old('active',$user->active))/>

```