locations = $this->locations ?? Location::all(); $short = $this->option('short') ?? $this->anticipate( trans('command/messages.location.ask_short'), $this->locations->pluck('short')->toArray() ); $location = $this->locations->where('short', $short)->first(); if (is_null($location)) { $this->error(trans('command/messages.location.no_location_found')); if ($this->input->isInteractive()) { $this->handle(); } return; } $this->deletionService->handle($location->id); $this->line(trans('command/messages.location.deleted')); } }