<?php

namespace Modules\Banner\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Modules\Category\Models\Category;
use Modules\Type\Models\Type;


class Banner extends Model
{
    //use soft delete
    use SoftDeletes;

    protected $fillable =
    [
        'status','active_status','show_all_pages','link','category_id','count_photo'
    ];

    public function photos()
    {
        return $this->hasMany(BannerPhoto::class);
    }

    public function type()
    {
        return $this->belongsTo(Type::class)->withTrashed();
    }
    public function category()
    {
        return $this->belongsTo(Category::class)->withTrashed();
    }
}
