Fix relationship
This commit is contained in:
@@ -13,7 +13,7 @@ class VarietiesDataTable extends DataTable
|
||||
public function query(Variety $model)
|
||||
{
|
||||
// $model = $model::with('specie')->withCount('Articles')->select('botanic_varieties.*');
|
||||
$model = $model::joinRelations('Specie')->select('botanic_varieties.*', 'botanic_species.name as specie_name')->with('Specie')->withCount('Articles');
|
||||
$model = $model::joinRelationship('Specie')->select('botanic_varieties.*', 'botanic_species.name as specie_name')->with('Specie')->withCount('Articles');
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user