The error "Attempt to read property 'id' on bool" means that you are trying to access the 'id' property on a boolean value (true/false). In this case, it is likely that the $type->color relationship is returning a boolean value instead of a collection of colors.
To fix this, you should check if the $type->color relationship is returning a collection before looping through it in the blade template. You can do this using the 'instanceof' operator to check if the value is an instance of the Illuminate\Database\Eloquent\Collection class.
Here's an updated version of the edit.blade.php file that includes this check:
@if ($type->color instanceof Illuminate\Database\Eloquent\Collection)
@foreach($type->color as $color)
<div class="mb-3 row">
<label for="color{{ $color->id }}" class="col-sm-2 col-form-label">{{ $color->color_name }}</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="color{{ $color->id }}" name="color[{{ $color->id }}]" value="{{ $type->price }}">
</div>
</div>
@endforeach
@endif
This will only loop through the $type->color relationship if it is an instance of the Collection class, which should prevent the "Attempt to read property 'id' on bool" error from occurring.