user()->can('create', RecurringInvoice::class); } public function rules() { return [ 'documents' => 'mimes:png,ai,svg,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx', 'client_id' => 'required|exists:clients,id,company_id,'.auth()->user()->company()->id, ]; } protected function prepareForValidation() { $input = $this->all(); if ($input['client_id']) { $input['client_id'] = $this->decodePrimaryKey($input['client_id']); } $input['line_items'] = isset($input['line_items']) ? $this->cleanItems($input['line_items']) : []; //$input['line_items'] = json_encode($input['line_items']); $this->replace($input); } public function messages() { } }