mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-23 19:37:23 +08:00
ptgen api point support parameter & default user
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?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');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user