In a controller function, I extract all the attributes
and the attributes that I have already used.
All the attributes:
$attributeNames = array('' => 'Select Attribute Name') + AttributeName::lists('name' , 'id');
Already Taken Attributes:
$selectedAttributeNames = $xmlDocument->masterInformation->masterAttributes;
How can I make the selectedAttributeNames
as disable
please?
Here is the output of var_dump($selectedAttributeNames)
:
object(Illuminate\ Database\ Eloquent\ Collection) #312 (1) {
["items":protected]= > array(1) {
[0] => object(MasterAttribute) #310 (20) {
["table":protected]= > string(16) "master_attribute"
["guarded": protected] => array(1) {
[0] => string(2) "id"
}
["connection": protected] => NULL["primaryKey": protected] => string(2) "id"
["perPage": protected] => int(15)["incrementing"] => bool(true)["timestamps"] => bool(true)["attributes": protected] => array(7) {
["id"] => int(1)["xpath"] => string(17)
"this is the xpath"
["attribute_name_id"] => int(1)["master_information_id"] => int(6)["default_value"] => string(25) "This is the default value"
["created_at"] => string(19) "2014-07-19 17:53:55"
["updated_at"] => string(19) "2014-07-19 17:53:55"
}
["original": protected] => array(7) {
["id"] => int(1)["xpath"] => string(17) "this is the xpath"
["attribute_name_id"] => int(1)["master_information_id"] => int(6)["default_value"] => string(25) "This is the default value"
["created_at"] => string(19) "2014-07-19 17:53:55"
["updated_at"] => string(19) "2014-07-19 17:53:55"
}
["relations": protected] => array(0) {}
["hidden": protected] => array(0) {}
["visible": protected] => array(0) {}
["appends": protected] => array(0) {}
["fillable": protected] => array(0) {}
["dates": protected] => array(0) {}
["touches": protected] => array(0) {}
["observables": protected] => array(0) {}
["with": protected] => array(0) {}
["morphClass": protected] => NULL["exists"] => bool(true)
}
}
}