mirror of
https://github.com/brunofontes/shareit.git
synced 2025-11-15 07:50:54 -03:00
Creating relationships between users/items/products
This commit is contained in:
@@ -13,6 +13,11 @@ class Item extends Model
|
||||
return $this->belongsTo(Product::class);
|
||||
}
|
||||
|
||||
public function users()
|
||||
{
|
||||
return $this->belongsToMany(User::class);
|
||||
}
|
||||
|
||||
public function free($product_id, $user_id)
|
||||
{
|
||||
return $query->where([
|
||||
|
||||
Reference in New Issue
Block a user