Belongs to sets a single-to-single relationship between two Models. Use it for fetching a parent Model associated with your class. Pass a Model class you want to reference as an argument.
#laravel#model
// Set the relationship in a Model fileclassSubItemextendsModel{publicfunctionitem(){return$this->belongsTo(Item::class);// SubItem belongs to an Item}}// Then, in a Controller, you can fetch the Item your Model belongs to. App\SubItem::first()->item;