Code Duplication    Length = 19-19 lines in 2 locations

src/Form/Elements/Tree.php 1 location

@@ 183-201 (lines=19) @@
180
    /**
181
     * @return Model
182
     */
183
    protected function getNodesModel()
184
    {
185
        $model = $this->nodes;
186
187
        if (is_string($model)) {
188
            $model = app($model);
189
        }
190
191
        if (!($model instanceof Model)) {
192
            throw new InvalidArgumentException(
193
                sprintf(
194
                    "Form tree element's nodes class must be instanced of '%s'.",
195
                    Model::class
196
                )
197
            );
198
        }
199
200
        return $model;
201
    }
202
203
    public function getNodesModelLabelAttribute()
204
    {

src/Traits/SelectOptionsFromModel.php 1 location

@@ 65-83 (lines=19) @@
62
    /**
63
     * @return Model
64
     */
65
    public function getOptionsModel()
66
    {
67
        $model = $this->options;
68
69
        if (is_string($model)) {
70
            $model = app($model);
71
        }
72
73
        if (!($model instanceof Model)) {
74
            throw new InvalidArgumentException(
75
                sprintf(
76
                    'The select options class must be instanced of "%s".',
77
                    Model::class
78
                )
79
            );
80
        }
81
82
        return $model;
83
    }
84
85
    /**
86
     *