On your Post model:
public function user()
{
return $this->belongsTo('App\User');
}
public function category()
{
return $this->belongsTo('App\Category');
}
Then in both your User and Category model you would have this function:
public function posts()
{
return $this->hasMany('App\Post');
}
You have a one-to-many relationship between Users and Posts, as well as Categories and Posts. In the future if you want a post to be able to have multiple users or categories associated with it then you would use a many-to-many relationship.