phpvms/app/Models/News.php

35 lines
483 B
PHP
Raw Normal View History

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