public function store(CreateCityRequest $req, Country $country, City $City) { foreach (explode("\n", $req->name) as $city_name) { $city = new City(); $city->name = $city_name; $city->country_id = $country->id; $city->save(); } $message = trans('lists::cities.create_success', ['name' => $city->name]); if (request('submit') == 'save') { return redirect()->back()->with('success', $message); } else { return redirect()->route('cities.index', $country->id)->with('success', $message); } }