File: /var/www/tracksgrid.com/app/Eventimagelocation.php
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Eventimagelocation extends Model
{
protected $fillable = [
'event_id',
'topLeftLat',
'topLeftLng',
'topRightLat',
'topRightLng',
'bottomLeftLat',
'bottomLeftLng',
'opacity',
];
protected $casts = [
'created_at' => 'datetime:d.m.Y H:i'
];
public function getTopLeftAttribute()
{
return '[' . $this->topLeftLat . ',' . $this->topLeftLng . ']';
}
public function getTopRightAttribute()
{
return '[' . $this->topRightLat . ',' . $this->topRightLng . ']';
}
public function getBottomLeftAttribute()
{
return '[' . $this->bottomLeftLat . ',' . $this->bottomLeftLng . ']';
}
protected $table = 'eventimage_locations';
}