I store a few checkboxes as array in Laravel, but I get an error on Foreach. Can someone help me?

in model

```php
public function setHandServiceAttribute($value)
{
    $this->attributes['handservice'] = json_encode($value);
}

public function getHandServiceAttribute($value)
{
    return $this->attributes['handservice'] = json_decode($value);
}

```

in checkbox

```xml
<div class="form-check mx-3">
  <input class="form-check-input" type="radio" id="1" value="کاشت" name="handservice[]">
  <label class="form-check-label" for="1">کاشت</label>
</div>
<div class="form-check mx-3">
  <input class="form-check-input" type="radio" id="2" value="کاور" name="handservice[]">
  <label class="form-check-label" for="2">کاور</label>
</div>

```

handservice is column of reservation table in database with value like this after store

```
["\u062a\u0631"]

```

and in view

```xml
@forelse($reservation->handservice as $hand)
  {{ $hand }},
@empty
  nothing
@endforlse

```

error

> 
> json\_decode(): Argument #1 ($json) must be of type string, array given
> 
> 
> 

I used this article but I get an error when one of the columns handservie is empty **handservice in nullable**

> 
> <https://hackthestuff.com/article/how-to-store-multiple-checkbox-value-in-database-in-laravel8>
> 
> 
>