ea3ab21beb
* Refactor notifications to allow easier plugins * Notification refactoring * Formatting * Move news to NewsService; cleanup of events * More refactoring; added send email out for news item and the template * Formatting * Formatting
34 lines
500 B
PHP
34 lines
500 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Contracts\Model;
|
|
|
|
/**
|
|
* @property string subject
|
|
* @property string body
|
|
*/
|
|
class News extends Model
|
|
{
|
|
public $table = 'news';
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
'subject',
|
|
'body',
|
|
];
|
|
|
|
public static $rules = [
|
|
'subject' => 'required',
|
|
'body' => 'required',
|
|
];
|
|
|
|
/**
|
|
* FOREIGN KEYS
|
|
*/
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class, 'user_id');
|
|
}
|
|
}
|