Fix uniqueness issue on saving edited fields

This commit is contained in:
snipe 2017-01-25 04:52:47 -08:00
parent b1a80f8ed8
commit 2a7469d898
2 changed files with 4 additions and 2 deletions

View file

@ -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'));
}

View file

@ -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" => "",