You might try something like:
class Store extends \Eloquent
{
protected $fillable = ['name', 'location'];
public function items()
{
return $this->hasMany('Item');
}
}
class Item extends \Eloquent
{
protected $fillable = [];
public function store()
{
return $this->belongsTo('Store');
}
}
Then wherever you retrieve your records:
$stores = Store::with('items')->all();
foreach ($stores as $store) {
$itemCount = $store->items()->count();
}
Hopefully that gets you close to something useable. :)