小编Tal*_*ain的帖子

在laravel集合对象中添加新元素

我想在$ items数组中添加新元素,我不想出于某些原因使用连接.

$items = DB::select(DB::raw('SELECT * FROM items WHERE items.id = '.$id.'  ;'));
        foreach($items as $item){
            $product = DB::select(DB::raw(' select * from product
                   where product_id = '. $id.';' ));

            $item->push($product);
        }
Run Code Online (Sandbox Code Playgroud)

我应该怎么做,请提前帮助thnx

php laravel-5 laravel-5.1

44
推荐指数
3
解决办法
9万
查看次数

未添加Laravel 5表单选择ID属性

使用laravel表单属性如下所示

{!! 
Form::select('industry', $industries,  array('class' =>
            'form-control', 'style'=>' resize:vertical; ',
            'id' => 'industryId')) 
!!}
Run Code Online (Sandbox Code Playgroud)

问题是我无法获得id'industrialId'HTML outout如下

__CODE__

请帮忙

php laravel

3
推荐指数
1
解决办法
2725
查看次数

标签 统计

php ×2

laravel ×1

laravel-5 ×1

laravel-5.1 ×1