public function getEdit(ChildRepository $childRepository, ParentRepository $parentRepository, $id) { $child = Child::findOrFail($id); $child = $childRepository->prepareForForm($child); $parents = $parentRepository->getParentsForSelect(); return view('children.childrenEdit', compact('child', 'parents')); }
public function postEdit(Request $request, ParentRepository $parentRepository, $id) { $parent = ParentModel::findOrFail($id); $this->validate($request, ParentModel::$rules); $parentRepository->update($parent, $request->all()); return redirect()->action('ParentsController@getEdit', [$id]); }
public function postSuccess(Request $request, Robokassa $robokassa, ParentRepository $parentRepository) { // dd($request->all()); if (!$robokassa->checkSuccessResponse($request->all())) { return 'bad'; } $telephone = $request->get('Shp_login'); $parent = $parentRepository->getParentByTelephone($telephone); $parent->setAccount($request->get('OutSum')); $parent->save(); }
public function postChooseTariff(Request $request, ParentRepository $parentRepository) { $tariff = Tariff::find($request->get('tariff_id')); $parent = $this->getParent(); $parentRepository->chooseTariff($parent, $tariff); }