@@ -33,11 +33,12 @@ public function rules()
3333 $ hasCoordiantes = $ this ->filled ('latitude ' ) && $ this ->filled ('longitude ' );
3434 $ hasLocation = $ this ->filled ('location ' );
3535 $ hasStreet = $ this ->filled ('street1 ' );
36+ $ hasAddress = $ this ->filled ('address ' );
3637
3738 // if creating then it's required
3839 if ($ isCreating ) {
3940 // if either has coordinated or location then it's not required
40- if ($ hasCoordiantes || $ hasLocation ) {
41+ if ($ hasCoordiantes || $ hasLocation || $ hasAddress ) {
4142 return false ;
4243 }
4344
@@ -57,11 +58,12 @@ public function rules()
5758 $ isCreating = $ this ->isMethod ('POST ' );
5859 $ hasCoordiantes = $ this ->filled ('latitude ' ) && $ this ->filled ('longitude ' );
5960 $ hasLocation = $ this ->filled ('location ' );
61+ $ hasAddress = $ this ->filled ('address ' );
6062
6163 // if creating then it's required
6264 if ($ isCreating ) {
6365 // if either has coordinated or location then it's not required
64- if ($ hasCoordiantes || $ hasLocation ) {
66+ if ($ hasCoordiantes || $ hasLocation || $ hasAddress ) {
6567 return false ;
6668 }
6769
@@ -71,6 +73,7 @@ public function rules()
7173 return false ;
7274 }),
7375 ],
76+ 'address ' => ['nullable ' ],
7477 'customer ' => ['nullable ' , new ExistsInAny (['vendors ' , 'contacts ' ], 'public_id ' )],
7578 'contact ' => ['nullable ' , new ExistsInAny (['vendors ' , 'contacts ' ], 'public_id ' )],
7679 'vendor ' => 'nullable|exists:vendors,public_id ' ,
0 commit comments