Summary
Fleetbase\FleetOps\Models\Order::driver() is declared as belongsTo(Driver::class) with no explicit foreign key, so Laravel infers driver_uuid from the method name. The orders table has no such column — the assigned driver is stored in driver_assigned_uuid. $order->driver is therefore always null.
Impact
NotificationRegistry::resolveNotifiable() resolves dynamic:* notifiables through Order::resolveDynamicNotifiable($property), which ends in $this->{$property}. Selecting Dynamic: Driver in Settings → Notifications for any order notification resolves to null, so nobody is notified. The option is present in the UI and silently does nothing.
Versions
Fleetbase v0.7.63 (fleetops v0.6.68); same code in v0.7.58.
Reproduction
$order = Order::whereNotNull('driver_assigned_uuid')->first();
$order->driver; // null
$order->driverAssigned; // Driver model
(new Order)->driver()->getForeignKeyName(); // "driver_uuid"
Schema::hasColumn('orders', 'driver_uuid'); // false
Schema::hasColumn('orders', 'driver_assigned_uuid'); // true
Through the UI: Settings → Notifications → Order Dispatched → add "Dynamic: Driver" → dispatch an order that has a driver assigned → no notification is delivered.
Suggested fix
public function driver(): BelongsTo|Builder
{
return $this->belongsTo(Driver::class, 'driver_assigned_uuid')->without(['devices', 'vendor']);
}
driverAssigned() already works because its method name matches the column.
Summary
Fleetbase\FleetOps\Models\Order::driver()is declared asbelongsTo(Driver::class)with no explicit foreign key, so Laravel infersdriver_uuidfrom the method name. Theorderstable has no such column — the assigned driver is stored indriver_assigned_uuid.$order->driveris therefore alwaysnull.Impact
NotificationRegistry::resolveNotifiable()resolvesdynamic:*notifiables throughOrder::resolveDynamicNotifiable($property), which ends in$this->{$property}. Selecting Dynamic: Driver in Settings → Notifications for any order notification resolves tonull, so nobody is notified. The option is present in the UI and silently does nothing.Versions
Fleetbase v0.7.63 (fleetops v0.6.68); same code in v0.7.58.
Reproduction
Through the UI: Settings → Notifications → Order Dispatched → add "Dynamic: Driver" → dispatch an order that has a driver assigned → no notification is delivered.
Suggested fix
driverAssigned()already works because its method name matches the column.