我试图在我的评论模型和用户模型之间建立联系,这样我就可以在我的post视图中获取用户的化身。我对雄辩的语法很陌生,所以请和我一起说吧。 protected $table = 'ucp_news_comments';
return $this->belongsTo(User::class);User.php
public function comm
post.php{ public function publisher() return $this->belongsTo('App\Models\User'); protected $fillable = ['title','image','price','Describtion','image1','image2','image3&
SQLSTATE42S22:未找到列:'where子句‘中1054个未知列'notices.notice_category_id’(SQL: select * from notices where notices.notice_category_id =1和notices.notice_category_id为null,notices.deleted_at为null) public function up() Schema::create('notices', func
这看起来非常简单,但却不起作用:class Reservation extends Model public function service() return $this->belongsTo('App\Landing');}
class Landing extends Model public function reservation() return $this->hasMany('App\Reserv