put('menu', 'member'); session()->put('title', 'Rechnungen erstellen'); return \Inertia::render('allpayment/Form', [ ]); } public function store(Request $request) { $request->validate([ 'year' => 'required|numeric' ]); foreach (Member::payable()->whereNoPayment($request->year)->get() as $member) { $member->createPayment([ 'nr' => $request->year, 'subscription_id' => $member->subscription_id, 'status_id' => Status::default(), ]); } return redirect()->back()->success('Zahlungen erstellt'); } }