Eloquent column list by key with array as values?

http://laravel.com/

http://kejyun.github.io/Laravel-4-Docum ... roduction/
回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Eloquent column list by key with array as values?

文章 yehlu »

http://stackoverflow.com/questions/2413 ... -as-values

代碼: 選擇全部

        $drivertypes = DriverType::all()->keyBy('id')->ToArray();
        dd($drivertypes);
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

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

文章 yehlu »

http://stackoverflow.com/questions/1472 ... ned-tables

代碼: 選擇全部

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

回到「laravel」