'required|max_length[100]', 'insurer' => 'required|max_length[45]', 'segment' => 'required|max_length[100]', ]; protected $validationMessages = [ 'vehicle_type' => ['required' => 'Vehicle type is required.'], 'insurer' => ['required' => 'Insurer is required.'], 'segment' => ['required' => 'Segment is required.'], ]; protected $skipValidation = false; // ------------------------------------------------------------------------- // Fetch grid filtered by vehicle_type // ------------------------------------------------------------------------- public function getByVehicleType(string $vehicleType): array { return $this ->where('vehicle_type', $vehicleType) ->orderBy('insurer', 'ASC') ->findAll(); } // ------------------------------------------------------------------------- // Fetch grid filtered by insurer + rto // ------------------------------------------------------------------------- public function getByInsurerAndRto(string $insurer, string $rto): array { return $this ->where('insurer', $insurer) ->where('rto', $rto) ->orderBy('vehicle_type', 'ASC') ->findAll(); } }