public function postNew(Request $request) { $this->validate($request, Tariff::$rules); // dd($request->all()); $tariff = Tariff::create($request->all()); return redirect()->action('TariffsController@getIndex')->with('flash_message', 'Тариф создан'); }
/** * @return \App\Models\Tariff */ private function createTariff() { $tariff = \App\Models\Tariff::create(['name' => 'BestOfTheBest', 'price' => 123, 'duration' => 10]); return $tariff; }