23eb9dcbda
* 384 Laravel 6 changes * Library versions * Update package versions * Add keyType to models * Remove unused dependencies * StyleCI fixes * Fix models for test * Fix tests output and update test runner * Unused imports * Update exceptions handler * Fix login page
30 lines
439 B
PHP
30 lines
439 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Contracts\Model;
|
|
|
|
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');
|
|
}
|
|
}
|