put('menu', 'member'); session()->put('title', 'Rechnungen erstellen'); return \Inertia::render('allpayment/VForm'); } public function store(Request $request): RedirectResponse { $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'); } }