Skip to content

Commit 7416adb

Browse files
authored
Merge pull request #625 from Laravel-Backpack/add-field-to-fillable-and-make-it-required
Add field to fillable and make it required
2 parents 382705b + 2a10ce5 commit 7416adb

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

app/Http/Requests/MonsterRequest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public function rules()
2525
return [
2626
'text' => 'required|min:5|max:255',
2727
'email' => 'nullable|email',
28+
'dummyicon' => 'required',
2829
];
2930
}
3031

@@ -48,7 +49,7 @@ public function attributes()
4849
public function messages()
4950
{
5051
return [
51-
//
52+
'dummyicon.required' => 'The field "Relationships (all field attributes are guessed)" in #Relationships tab is required.',
5253
];
5354
}
5455
}

app/Models/Monster.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Monster extends Model
3030
public $timestamps = true;
3131

3232
// protected $guarded = ['id'];
33-
protected $fillable = ['address_google', 'base64_image', 'browse', 'browse_multiple', 'checkbox', 'wysiwyg', 'color', 'date', 'date_picker', 'easymde', 'start_date', 'end_date', 'datetime', 'datetime_picker', 'email', 'hidden', 'icon_picker', 'image', 'month', 'number', 'float', 'password', 'radio', 'range', 'select', 'select_from_array', 'select2', 'select2_from_ajax', 'select2_from_array', 'summernote', 'table', 'textarea', 'text', 'tinymce', 'upload', 'upload_multiple', 'url', 'video', 'week', 'extras', 'icon_id', 'editable_checkbox', 'fake-text', 'fake-switch', 'fake-checkbox', 'fake-select', 'status', 'features', 'ckeditor', 'dropzone', 'category_relationship', 'select2_json_from_api', 'select2_json_from_api_simple'];
33+
protected $fillable = ['address_google', 'base64_image', 'browse', 'browse_multiple', 'checkbox', 'wysiwyg', 'color', 'date', 'date_picker', 'easymde', 'start_date', 'end_date', 'datetime', 'datetime_picker', 'email', 'hidden', 'icon_picker', 'image', 'month', 'number', 'float', 'password', 'radio', 'range', 'select', 'select_from_array', 'select2', 'select2_from_ajax', 'select2_from_array', 'summernote', 'table', 'textarea', 'text', 'tinymce', 'upload', 'upload_multiple', 'url', 'video', 'week', 'extras', 'icon_id', 'editable_checkbox', 'fake-text', 'fake-switch', 'fake-checkbox', 'fake-select', 'status', 'features', 'ckeditor', 'dropzone', 'category_relationship', 'select2_json_from_api', 'select2_json_from_api_simple', 'belongs_to_non_nullable'];
3434

3535
// protected $hidden = [];
3636
protected $casts = [

0 commit comments

Comments
 (0)