feat: add postcode resolution to /api/stations and Filament SearchResource
Extends NearbyStationsRequest to accept `postcode` (full or outcode) as an alternative to lat/lng. PostcodeService resolves it via postcodes.io and falls through to coordinates. Also adds SearchResource to the Filament admin panel for viewing logged search activity with fuel type filter and price/distance stats columns. Includes SQLite GREATEST/LEAST function polyfills in AppServiceProvider for test compatibility. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -15,8 +15,9 @@ class NearbyStationsRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'lat' => ['required', 'numeric', 'between:-90,90'],
|
||||
'lng' => ['required', 'numeric', 'between:-180,180'],
|
||||
'postcode' => ['nullable', 'string', 'max:10'],
|
||||
'lat' => ['required_without:postcode', 'nullable', 'numeric', 'between:-90,90'],
|
||||
'lng' => ['required_without:postcode', 'nullable', 'numeric', 'between:-180,180'],
|
||||
'fuel_type' => ['required', 'string'],
|
||||
'radius' => ['nullable', 'numeric', 'between:0.1,50'],
|
||||
'sort' => ['nullable', 'string', 'in:price,distance'],
|
||||
|
||||
Reference in New Issue
Block a user