mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-03 14:10:57 +08:00
24 lines
398 B
PHP
24 lines
398 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
class News extends NexusModel
|
|
{
|
|
protected $table = 'news';
|
|
|
|
protected $fillable = [
|
|
'userid', 'added', 'title', 'body', 'notify',
|
|
];
|
|
|
|
protected $casts = [
|
|
'added' => 'datetime',
|
|
];
|
|
|
|
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'userid');
|
|
}
|
|
|
|
|
|
}
|