Add news tables and models #52
This commit is contained in:
32
app/Models/News.php
Normal file
32
app/Models/News.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
/**
|
||||
* Class News
|
||||
* @package App\Models
|
||||
*/
|
||||
class News extends BaseModel
|
||||
{
|
||||
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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user