mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-26 06:04:08 -08:00
Fix uniqueness issue on saving edited fields
This commit is contained in:
parent
b1a80f8ed8
commit
2a7469d898
|
@ -186,8 +186,7 @@ class CustomFieldsController extends Controller
|
|||
|
||||
$validator = Validator::make(Input::all(), $field->rules);
|
||||
|
||||
if ($validator->passes()) {
|
||||
$field->save();
|
||||
if ($field->save()) {
|
||||
return redirect()->route("fields.index")->with("success", trans('admin/custom_fields/message.field.update.success'));
|
||||
}
|
||||
|
||||
|
|
|
@ -3,9 +3,12 @@ namespace App\Models;
|
|||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Schema;
|
||||
use Watson\Validating\ValidatingTrait;
|
||||
use App\Http\Traits\UniqueUndeletedTrait;
|
||||
|
||||
class CustomField extends Model
|
||||
{
|
||||
use ValidatingTrait, UniqueUndeletedTrait;
|
||||
public $guarded=["id"];
|
||||
public static $PredefinedFormats=[
|
||||
"ANY" => "",
|
||||
|
|
Loading…
Reference in a new issue