1 頁 (共 1 頁)

Eloquent column list by key with array as values?

發表於 : 2016-12-26 10:24:30
yehlu
http://stackoverflow.com/questions/2413 ... -as-values

代碼: 選擇全部

        $drivertypes = DriverType::all()->keyBy('id')->ToArray();
        dd($drivertypes);

Re: Eloquent column list by key with array as values?

發表於 : 2016-12-26 10:33:13
yehlu
http://stackoverflow.com/questions/1472 ... ned-tables

代碼: 選擇全部

        $user1 = \DB::table('driver_types')->pluck('driver_type');
        dd($user1);