$this->middleware('middlewareName')->except('about');
$comment->user->name
class Item extends Model
{
protected $fillable = ['name'];
public function category() {
return $this->belongsToMany('App\Category', 'category_items','item_id','category_id');
}
}
class Category extends Model
{
protected $fillable = ['title'];
public function item() {
return $this->belongsToMany('App\Item', 'category_items', 'category_id', 'item_id');
}
}
return $this->belongsToMany(
Article::class,
'article_related',
'article_id',
'related_id'
);