Fixes #4094 - more nullables

This commit is contained in:
snipe 2017-10-01 14:32:47 -07:00
parent 0bb186ad3b
commit 07359c76ad
2 changed files with 13 additions and 14 deletions

View file

@ -87,9 +87,8 @@ class SuppliersController extends Controller
$supplier->image = $file_name;
}
// Was it created?
if ($supplier->save()) {
// Redirect to the new supplier page
// Redirect to the nw supplier page
return redirect()->route('suppliers.index')->with('success', trans('admin/suppliers/message.create.success'));
}
return redirect()->back()->withInput()->withErrors($supplier->getErrors());

View file

@ -15,18 +15,18 @@ class Supplier extends SnipeModel
protected $rules = array(
'name' => 'required|min:3|max:255|unique_undeleted',
'address' => 'min:3|max:50',
'address2' => 'min:2|max:50',
'city' => 'min:3|max:255',
'state' => 'min:0|max:32',
'country' => 'min:0|max:2',
'fax' => 'min:7|max:35',
'phone' => 'min:7|max:35',
'contact' => 'min:0|max:100',
'notes' => 'min:0|max:255',
'email' => 'email|min:5|max:150',
'zip' => 'min:0|max:10',
'url' => 'min:3|max:250',
'address' => 'max:50|nullable',
'address2' => 'max:50|nullable',
'city' => 'max:255|nullable',
'state' => 'max:32|nullable',
'country' => 'max:3|nullable',
'fax' => 'min:7|max:35|nullable',
'phone' => 'min:7|max:35|nullable',
'contact' => 'max:100|nullable',
'notes' => 'max:255|nullable',
'email' => 'email|max:150|nullable',
'zip' => 'max:10|nullable',
'url' => 'url|nullable',
);
/**