phpvms/app/Models/News.php
2018-03-19 20:50:40 -05:00

35 lines
483 B
PHP

<?php
namespace App\Models;
use App\Interfaces\Model;
/**
* Class News
* @package App\Models
*/
class News extends Model
{
public $table = 'news';
public $fillable = [
'user_id',
'subject',
'body',
];
public static $rules = [
'subject' => 'required',
'body' => 'required',
];
/**
* FOREIGN KEYS
*/
public function user()
{
return $this->belongsTo(User::class, 'user_id');
}
}