Thursday, April 26, 2018

Laravel why store array position instead his name - development

Laravel why store array position instead his name

why store array position instead his name.

BLADE

My blade file where i have my list of category

<div class="col-md-2">
                <div class="form-group">
                    <label for="role">Category</label>
                    <div class="fg-line">
                        <div class="select">
                        {!! Form::select('category', $categorylist,null,array('class' => 'form-control')) !!}
                        </div>
                    </div>
                </div>

controller

my controller where take data from query to send to blade file

$categorylist = Category::where('category','=','cat')
                    ->groupby('catlist')
                    ->pluck('catlist');

                    //dd($categorylist);


return view('addcategory')
    ->with(
        [
            'categorylist' => $categorylist
        ]
);



from Laravel Questions and Answers https://laravelquestions.com/laravel/laravel-why-store-array-position-instead-his-name/
via Lzo Media

No comments:

Post a Comment