--- /dev/null
+<?php
+
+
+namespace Cubist\Backpack\app\Magic\Fields;
+
+
+class Number extends Field
+{
+ protected $_adminType = 'number';
+ protected $_databaseType = 'float';
+}
}
/**
- * @param $field Field
+ * @param $field Field|string
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo|\Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function relationship($field)
{
+ if (is_string($field)) {
+ foreach ($this->_fields as $f) {
+ if($f->getAttribute('entity')==$field){
+ $field=$f;
+ break;
+ }
+ }
+ }
switch ($field->getRelationship()) {
case 'belongsTo':
return $this->belongsTo($field->getAttribute('model'), $field->getAttribute('name'));