/** * @param $name * @return mixed * @throws BadRequestDataException */ protected function findShuttle($name) { $shuttle = Shuttle::where('name', $name)->first(); if (!$shuttle) { throw new BadRequestDataException("Shuttle {$name} does not exist"); } $this->shuttle = $shuttle; return $shuttle; }