lunar icon indicating copy to clipboard operation
lunar copied to clipboard

Not possible to eager load Cart lines

Open alecritson opened this issue 2 years ago • 1 comments

  • GetCandy version: any
  • Laravel Version: any
  • PHP Version: any

Expected Behaviour:

Be able to eager load in cart lines when you have a Cart model

Actual Behaviour:

Once you have the Cart model and try to load the lines, the totals will be blank.

Steps To Reproduce:

CartSession::current()->load('lines');

alecritson avatar Apr 11 '22 15:04 alecritson

Do we need to use Lazy Eager Loading? Would it suffice to add it to the Cart model?

e.g.

class Cart extends Model
{
    protected $with = ['lines'];

glennjacobs avatar Jun 14 '22 16:06 glennjacobs