ptgen api point support parameter & default user

This commit is contained in:
xiaomlove
2022-02-28 23:20:42 +08:00
parent 5ed80ed637
commit b9d5df232b
51 changed files with 447 additions and 51 deletions
+23
View File
@@ -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');
}
}