|
|
@ -11,6 +11,10 @@ class Slider extends Model
|
|
|
|
use HasFactory,HasTranslations;
|
|
|
|
use HasFactory,HasTranslations;
|
|
|
|
public $translatable = ['body'];
|
|
|
|
public $translatable = ['body'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected $casts = [
|
|
|
|
|
|
|
|
'dataz'
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
public function imgUrl()
|
|
|
|
public function imgUrl()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ($this->image == null) {
|
|
|
|
if ($this->image == null) {
|
|
|
@ -24,4 +28,13 @@ class Slider extends Model
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return $this->belongsTo(User::class);
|
|
|
|
return $this->belongsTo(User::class);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getDatazAttribute(){
|
|
|
|
|
|
|
|
$result = [];
|
|
|
|
|
|
|
|
foreach (json_decode($this->data) as $item) {
|
|
|
|
|
|
|
|
$result[$item->key] = $item->value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $result;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|