Files
exchange/app/Announcement.php
T
2020-10-08 14:54:25 +08:00

38 lines
793 B
PHP

<?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());
// }
}