$modelClass = $this->getAttribute('optionsmodel');
$inst = new $modelClass();
- return $modelClass::all()->pluck($this->getAttribute('attribute'), $inst->getPrimaryKey())->toArray();
+ $attr=$this->getAttribute('attribute');
+ return $modelClass::orderBy($attr)->get()->pluck($attr, $inst->getPrimaryKey())->toArray();
}
public function getDatabaseType()
// The slug is created automatically from the "title" field if no slug exists.
public function getSlugOrTitleAttribute()
{
-
foreach ($this->_slugFields as $item) {
if (isset($this->$item) && $this->item != '') {
return $this->$item;