mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 13:57:41 -08:00
Fixes #4094 - more nullables
This commit is contained in:
parent
0bb186ad3b
commit
07359c76ad
|
@ -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());
|
||||||
|
|
|
@ -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',
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue