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; $supplier->image = $file_name;
} }
// Was it created?
if ($supplier->save()) { 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()->route('suppliers.index')->with('success', trans('admin/suppliers/message.create.success'));
} }
return redirect()->back()->withInput()->withErrors($supplier->getErrors()); return redirect()->back()->withInput()->withErrors($supplier->getErrors());

View file

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