$property_category_detail = PropertyCategory::where('property_category_slug',$slug)->first();
$property_items = Property::with('rPropertyCategory','rPropertyLocation')->where('property_category_id',$property_category_detail->id)->paginate(15);
$property_category_detail değişkeninin null olduğu durumu kontrol etmeniz gerekmektedir. Eğer PropertyCategory::where('property_category_slug',$ slug)->first() sorgusu sonucunda geçerli bir sonuç dönmüyorsa, $property_category_detail null olacaktır ve bu da "id" özelliğine erişmeye çalışırken "Attempt to read property 'id' on null" hatasına neden olur.
Çözüm olarak, $property_category_detail değişkeninin null olup olmadığını kontrol ederek bu duruma karşı önlem almanız gerekmektedir. Debug ederek gelen datayı görebilirsiniz. Örnek olarak:
dd($property_category_detail);
Yukarıdan aşağıya kodu debug ederek ilerleyebilirsiniz.