Reverses the modern Attribute-method approach: the Flight model no
longer carries dptTime/arrTime accessors. Instead, the canonical
columns are `departure_time` / `arrival_time` (Carbon, datetime:H:i:s
cast); the legacy `dpt_time` / `arr_time` `Hi`-formatted strings are
projected onto the JSON payload only by FlightResource at API response
time.
Why
- Public Attribute methods on a model are queryable surface and shouldn't
be hidden behind protected visibility just to satisfy Larastan's
modelAppends rule. Removing the methods (and the matching `$appends`
entries) sidesteps the rule entirely.
- Keeps the API contract stable (`dpt_time`/`arr_time` still appear in
responses, `departure_time`/`arrival_time` stay hidden) while
internal code paths use the structured columns directly.
Model
- Removed `dptTime()` / `arrTime()` Attribute methods from Flight.
- Removed `dpt_time` / `arr_time` from `$appends`.
- Kept `departure_time` / `arrival_time` in `$hidden` (matches the
contract locked by FlightResourceTimeFieldsTest).
- Dropped the now-unused `FlightTimeParser` import.
API resource
- FlightResource::toArray() now formats `dpt_time` / `arr_time` from
the Carbon columns at response time. BidFlightResource inherits the
projection via parent::toArray().
Form / factory
- FlightForm: TimePicker now binds to `departure_time` / `arrival_time`.
- FlightFactory: default state generates `departure_time` /
`arrival_time` instead of the legacy keys.
Import / export plumbing
- Filament FlightImporter: kept the `dpt_time` / `arr_time` CSV column
headers for backward compat; `fillRecordUsing` now parses via
FlightTimeParser and writes through setAttribute('departure_time'/
'arrival_time') to satisfy PHPStan's strict property typing.
- Filament FlightExporter: same CSV headers, `state()` callbacks
format `Hi` from the structured columns.
- Service FlightImporter: transforms legacy keys to structured keys
in import() before firstOrNew mass-assign.
- Service FlightExporter: overrides the array keys after the column
loop so CSV columns continue to use the legacy header names with
Carbon-derived values.
- LegacyImporter (old phpvms import): parses source `deptime`/`arrtime`
into `departure_time`/`arrival_time` directly.
Tests
- Deleted tests/Unit/Models/FlightTimeAccessorTest.php (covered behavior
that no longer exists on the model).
- FlightResourceTimeFieldsTest now seeds via `departure_time` /
`arrival_time` factory state; assertions on the projected
`dpt_time` / `arr_time` keys remain.
- ImporterTest: end-of-import assertions read
`$flight->departure_time->format('Hi')` instead of `$flight->dpt_time`.
All four gates green; affected suites: 104 tests pass.
* wip
* refactor: update enum handling and improve type hints across models
* refactor: deprecate labels and select methods in HasSelect trait for better separation of concerns
* copilot suggestions
Enable Laravel's preventLazyLoading in dev/test environments to catch
N+1 query regressions during the upcoming repository refactor phases.
Fixes 3 distinct N+1 patterns revealed by the check (7 failing tests):
- Expense::ref_model: eager-load in ExpenseRepository::getAllForType
and RecurringFinanceService::processExpenses (also in ImporterTest).
- Flight::airline: eager-load in SetActiveFlights::checkFlights where
the Flight::ident accessor triggers lazy load via Log::info.
- Pirep::aircraft: add 'aircraft' to the eager loads in
Api/UserController::pireps so the Pirep Resource doesn't lazy load
aircraft during response serialization.
Part of Phase 0 for the Prettus repository removal.
* wip
* fix simbrief tests
* more fixes
* run pint
* fix(tests): fake notifications in registration test
* refactor(tests): AI suggestions and performance improvements
* deprecation warning with PHP85
* fix(tests): fake notifications in access with valid invite test
* refactor(build): optimize autoload and remove unnecessary commands
* refactor(tests): update PHPUnit configuration and improve test structure
* refactor: put GeoJson under the right namespace