hasMany(ItemCarrinhoDelivery::class, 'carrinho_id'); } public function itensProdutos(){ return $this->hasMany(ItemCarrinhoDelivery::class, 'carrinho_id')->where('produto_id', '!=', null); } public function itensServico(){ return $this->hasMany(ItemCarrinhoDelivery::class, 'carrinho_id')->where('servico_id', '!=', null); } public function endereco(){ return $this->belongsTo(EnderecoDelivery::class, 'endereco_id'); } public function cliente(){ return $this->belongsTo(Cliente::class, 'cliente_id'); } }