public function action_detail($orderId)
{
$customerWithOrderDetails = Customer::with(array('order' => function($query)
{ global $orderId;
$query->where('id', '=', $orderId);
}, 'order.orderdetail', 'order.attachment'))->find(Auth::user()->id);
return var_dump($customerWithOrderDetails);
}
I am getting "variable undefined" error. Why?