'required', 'asin' => $this->source['has_product'] ? 'required' : 'nullable', 'title' => $this->source['has_product'] ? 'required' : 'nullable', 'category' => 'required', 'status' => 'required', 'product' => $this->source['has_product'] ? 'required' : 'nullable', 'product.price' => 'nullable', 'product.link' => 'required_if:source_id,==,3', 'status' => 'required', 'notes' => 'max:1500|nullable', 'ship_to' => $this->category['will_be_shipped'] ? 'required' : 'nullable', 'post_to' => $this->category['will_be_posted'] ? 'required' : 'nullable' ]; } public function messages() { return [ 'title.required' => 'Name of Product is required!', 'notes.max' => 'Max of 1500 characters only for notes!' ]; } /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return !!auth()->id(); } }