Aleved
Aleved
FFilament
Created by trymedo on 5/26/2024 in #❓┊help
RelationManager width / colspan?
Looks like a custom page already? So I think you just want:
<div class="grid grid-cols-3 gap-4">
<div class="col-span-2">
<!-- players table -->
</div>
<div class="col-span-1">
<!-- game stats -->
</div>
</div>
<div class="grid grid-cols-3 gap-4">
<div class="col-span-2">
<!-- players table -->
</div>
<div class="col-span-1">
<!-- game stats -->
</div>
</div>
4 replies
FFilament
Created by H.Bilbao on 1/24/2025 in #❓┊help
Table, access previous or another record data
You'd want to do this within your model, something like this:
public function getPreviousRow()
{
return static::where('id', '<', $this->id)
->orderBy('id', 'desc')
->first();
}

public function getNextRow()
{
return static::where('id', '>', $this->id)
->orderBy('id', 'asc')
->first();
}
public function getPreviousRow()
{
return static::where('id', '<', $this->id)
->orderBy('id', 'desc')
->first();
}

public function getNextRow()
{
return static::where('id', '>', $this->id)
->orderBy('id', 'asc')
->first();
}
If you're using mysql 8 (or postgres) you can also look at the window functions, and probably just join them directly. The functions are LEAD() and LAG().
8 replies