<?php

namespace TPS\Shop\Models;
use Illuminate\Support\Facades\Storage;
use Webkul\Core\Models\Slider as SliderModel;
class Slider extends SliderModel
{
    protected $appends = ['image_url','mobile_image_url'];
    protected $fillable = [
        'title',
        'path',
        'content',
        'channel_id',
        'locale',
        'expired_at',
        'sort_order',
        'type',
        'mobile_path',
        'mobile_link'
    ];

    /**
     * Get image url for the category image.
     *
     * @return string
     */
    public function mobile_image_url()
    {
        if (! $this->mobile_path) {
            return '';
        }

        return Storage::url($this->mobile_path);
    }

    /**
     * Get image url for the category image.
     *
     * @return string
     */
    public function getMobileImageUrlAttribute()
    {
        return $this->mobile_image_url();
    }
}