Use another column in the url for ID

I have a separate panel for sellers and I want to get orders by their reference ('FGIBNTSC02HD') instead of their ID ('123'). Can I set this on Filament level? I know I can set it on model level but that's not what I'm looking for. I just want it for this particular panel.
Solution
@awcodes Turns out it was way easier than I had thought initially (was probably overthinking it). I remembered you can just add the key to the route:

    public static function getPages(): array
    {
        return [
            'index' => Pages\ListOrders::route('/'),
            'create' => Pages\CreateOrder::route('/create'),
            'edit' => Pages\EditOrder::route('/{record:reference}/edit'),
            'details' => Pages\ViewOrderDetails::route('/{record:reference}/details'
        ];
    }

and then override the function that resolves the record:

    protected function resolveRecord(int | string $key): Model
    {
        $record = Order::whereReference($key)->first();

        if ($record === null) {
            throw (new ModelNotFoundException())->setModel($this->getModel(), [$key]);
        }

        return $record;
    }
Was this page helpful?