Laravel 5.2 调试不工作并且 public 变量无法访问

Laravel 5.2 Debugging not working and public variable can't able to access

我有一个如下所示的控制器

class CustomerController extends Controller
{
    public $customerColums;

    function _construct()
    {

         $this->customerColums = array('username','unique_id','first_name','email','profile_image','contract_id','address','telephone','priority_id','segment_id','class_id','is_active','is_deleted');

    }

    public function index()
    {
        echo '<pre>';print_r($this->customerColums);die;
    }
}

但是这个 public 变量没有显示页面显示为空并且写入了日志文件。

我已授予文件权限并设置调试 => TRUE

没有显示?我该如何调试?

应该是public function index(),而不只是public index()

你错了,构造函数有两个前导下划线,而不仅仅是一个 __construct()。对于调试,请尝试使用此 die(var_dump($this->customerColumns));。它会转储 varibale 并死掉。