add geolocation for datacite metadata anf for backend

This commit is contained in:
Arno Kaimbacher 2019-01-07 11:16:18 +01:00
parent e7d8dc21a0
commit ba38fc1ed1
16 changed files with 3833 additions and 6047 deletions

View file

@ -53,11 +53,11 @@ class Dataset extends Model
}
/**
* Get the user that owns the phone.
* Get the geolocation that owns the dataset.
*/
public function geolocation()
{
return $this->belongsTo(GeolocationBox::class, 'dataset_id', 'id');
return $this->hasOne(GeolocationBox::class, 'dataset_id', 'id');
}
/**

View file

@ -15,7 +15,7 @@ class GeolocationBox extends Model
'xmin' => 'float',
'xmax' => 'float',
'ymin' => 'float',
'ymax' => 'float'
'ymax' => 'float',
];
public function dataset()

View file

@ -39,7 +39,7 @@ class Person extends Model
*/
public function getFullNameAttribute()
{
return $this->first_name . " " . $this->last_name;
return $this->first_name . " " . $this->last_name . " " . $this->date_of_birth;
}
public function scopeActive($query)