2020-09-11 22:51:45 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
2020-09-13 18:39:38 +01:00
|
|
|
class Sensor extends Model
|
2020-09-11 22:51:45 +01:00
|
|
|
{
|
|
|
|
use HasFactory;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The attributes that are mass assignable.
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $fillable = [
|
2020-09-13 18:39:38 +01:00
|
|
|
'status',
|
2020-09-11 22:51:45 +01:00
|
|
|
'longitude',
|
|
|
|
'latitude',
|
|
|
|
];
|
2020-09-13 18:39:38 +01:00
|
|
|
|
|
|
|
public function user()
|
|
|
|
{
|
|
|
|
return $this->belongsTo('App\Models\User');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function readings()
|
|
|
|
{
|
|
|
|
return $this->hasMany('App\Models\Reading');
|
|
|
|
}
|
2020-09-11 22:51:45 +01:00
|
|
|
}
|