Herkese merhaba,
Laravel voyager json_decode() hatası alıyordum. Bu hata ile ilgili üst sürümde düzenleme yapmışlar git de yayınlanan dosyalar ile güncelleme yaparak hatayı aştım ama düzenleme işlemi yaptığımda controllerda aşağıdaki hatayı veriyor. Problemi aşamıyorum bana yardımcı olur musunuz ?
` public function edit(Request $request, $id)
{
$slug = $this->getSlug($request);
$dataType = Voyager::model('DataType')->where('slug', '=', $slug)->first();
// Compatibility with Model binding.
$id = $id instanceof Model ? $id->{$id->getKeyName()} : $id;
$dataTypeContent = (strlen($dataType->model_name) != 0)
? app($dataType->model_name)->findOrFail($id)
: DB::table($dataType->name)->where('id', $id)->first(); // If Model doest exist, get data from table name
foreach ($dataType->editRows as $key => $row) {
$details = json_decode($row->details);
$dataType->editRows[$key]['col_width'] = isset($details->width) ? $details->width : 100;
}
// If a column has a relationship associated with it, we do not want to show that field
$this->removeRelationshipField($dataType, 'edit');
// Check permission
$this->authorize('edit', $dataTypeContent);
// Check if BREAD is Translatable
$isModelTranslatable = is_bread_translatable($dataTypeContent);
$view = 'voyager::bread.edit-add';
if (view()->exists("voyager::$slug.edit-add")) {
$view = "voyager::$slug.edit-add";
}
$allCategories = Category::all();
$product = Product::find($id);
$categoriesForProduct = $product->categories()->get();
return Voyager::view($view, compact('dataType', 'dataTypeContent', 'isModelTranslatable', 'allCategories', 'categoriesForProduct'));
}`