Hide table column if relationship does'nt exist?
TextColumn::make('velicina_bicikla.velicina')
->size('sm')
->description('veličina rama'),
In my model:
public function velicina_bicikla()
{
return $this->belongsToMany(VelicinaBicikla::class, 'bicikli_velicine_bicikla', 'biciklID', 'velicinaBiciklaID')->withTimestamps();
}
How to hide this column (realtionship) only on records where it does not exist?2 Replies
How should hiding a column in some rows work in a table? That would break the layout. What's the issue if the column is still there?
You're right. There is no issue, I just wanted to hide it if it's null or there's no relationship.