add area to history
This commit is contained in:
@@ -70,6 +70,7 @@ class RahdariPoint extends Model
|
||||
'lat_to',
|
||||
'lng_to',
|
||||
'updated_at_fa',
|
||||
'area'
|
||||
];
|
||||
|
||||
public function files(): MorphMany
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RahdariPointHistory extends Model
|
||||
@@ -33,11 +34,19 @@ class RahdariPointHistory extends Model
|
||||
'previous_lat',
|
||||
'previous_lng',
|
||||
'new_files',
|
||||
'point_id'
|
||||
'point_id',
|
||||
'area'
|
||||
];
|
||||
|
||||
public function rahdariPoint()
|
||||
{
|
||||
return $this->belongsTo('App\Models\RahdariPoint');
|
||||
}
|
||||
|
||||
protected function area(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => json_decode($value)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user