accounts_all ->contains(request()->post('account_id')); } /** * Get the validation rules that apply to the request. * * @return array|string> */ public function rules(): array { Session::put('charge_add',true); return [ 'id' => 'sometimes|exists:charges,id', 'account_id' => 'required|exists:accounts,id', 'charge_at' => 'required|date', 'service_id' => 'required|exists:services,id', 'site_id' => 'required|exists:sites,id', 'quantity' => 'required|numeric|not_in:0', 'amount' => 'required|numeric|min:0.01', 'sweep_type' => 'required|numeric|in:'.implode(',',array_keys(Charge::sweep)), 'type' => 'required|numeric|in:'.implode(',',array_keys(InvoiceItem::type)), 'taxable' => 'nullable|boolean', 'description' => 'nullable|string|min:5|max:128', ]; } }