Merge pull request #674 from jitendra-webkul/jitendra

Modified Slider Model
This commit is contained in:
Jitendra Singh 2019-03-11 18:44:06 +05:30 committed by GitHub
commit ff45ce45d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 2 deletions

View File

@ -3,6 +3,7 @@
namespace Webkul\Core\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Storage;
use Webkul\Core\Contracts\Slider as SliderContract;
class Slider extends Model implements SliderContract
@ -12,10 +13,28 @@ class Slider extends Model implements SliderContract
*
* @var array
*/
protected $table = 'sliders';
protected $fillable = [
'title', 'path','content','channel_id'
'title', 'path', 'content', 'channel_id'
];
/**
* Get image url for the category image.
*/
public function image_url()
{
if (! $this->path)
return;
return Storage::url($this->path);
}
/**
* Get image url for the category image.
*/
public function getImageUrlAttribute()
{
return $this->image_url();
}
}