<?php

namespace App\Models;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;

class Banner extends Model
{

    protected $fillable = [
        'screen',
        'order',
        'img',
    ];


    public function getCreatedAtAttribute($date)
    {
        return Carbon::parse($date)->format('Y-m-d h:i A');
    }

    public function getUpdatedAtAttribute($date)
    {
        return Carbon::parse($date)->format('Y-m-d h:i A');
    }


    public function course()
    {
        return $this->belongsTo(Course::class);
    }

    public function lecture()
    {
        return $this->belongsTo(Lecture::class);
    }
}
