user()->isAdmin(); } public function rules() { return [ '*.id' => 'required|bail', '*.invoice_id' => 'nullable|sometimes', '*.is_expense' => 'nullable|sometimes|bool', '*.amount' => 'nullable|sometimes|numeric' ]; } public function prepareForValidation() { $input = $this->all(); $input = $this->decodePrimaryKeys($input); $this->replace($input); } }