Жалобы на модели
class complaints extends Model {
public function broad_categorys()
{
return $this->belongsTo(Broad_category::class);
}
public function referred_programs()
{
return $this->hasMany(Referred_program::class);
}
public function specific_categorys()
{
return $this->belongsTo(Specific_category::class);
}
public function provinces()
{
return $this->belongsTo(Provinces::class);
}
public function districts()
{
return $this->belongsTo(Districts::class);
}
}
Модель Referred_to
class Referred_program extends Model
{
public function complaints() {
return $this->belongsTo(Complaints::class);
}
}
Модель Broad_category
class broad_category extends Model
{
public function complaints() {
return $this->hasOne(Complaints::$this);
}
}
Specific_category Модель
class specific_category extends Model
{
public function complaints() {
return $this->hasOne(Complaints::$this);
}
}
Это редактирование просмотрите, какие я хочу использовать данные refer_to, Specific_category и Broad_category
<div class="col-md-6">
<select name="broad_category" id="broad_category" class="form-control">
@foreach($data->broad_categorys == $category)
<option value="{{$category->id}}">{{$category->broad_cat_name}}</option>
@endforeach
</select>
</div>