<?php

namespace App;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

use Carbon\Carbon;//call to carbon to return the current time with a Carbon instance

class Announcement extends Model
{
    use HasFactory;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'start_date', 'end_date', 'content',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $table = 'announcements';


//    //call to get active announcements
//    public function scopeActive($query)
//    {
//        return $query->where('start_date', '<=', Carbon::now())
//            ->where('end_date', '>=', Carbon::now());
//    }
}
