Commit 850e70a
committed
Fix: BadMethodCallException for getDeletedAtColumn() on models without SoftDeletes
Issue: shouldQualifyColumn() method was unconditionally calling getDeletedAtColumn()
which only exists on models using the SoftDeletes trait. This caused a fatal error
when querying models like Permission that don't use soft deletes.
Error:
BadMethodCallException: Call to undefined method Fleetbase\Models\Permission::getDeletedAtColumn()
Fix: Check if the method exists before calling it using method_exists().
Only include deleted_at column in qualifiable columns if the model uses SoftDeletes.
Impact:
- Fixes fatal error when querying Permission and other non-soft-deletable models
- Maintains backward compatibility with models that do use SoftDeletes
- No functional changes to soft-delete behavior1 parent 42a2335 commit 850e70a
1 file changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1125 | 1125 | | |
1126 | 1126 | | |
1127 | 1127 | | |
1128 | | - | |
| 1128 | + | |
1129 | 1129 | | |
1130 | 1130 | | |
1131 | 1131 | | |
1132 | | - | |
1133 | | - | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
1134 | 1140 | | |
1135 | 1141 | | |
1136 | 1142 | | |
| |||
0 commit comments