Answers for "add array elements in laravel"

PHP
1

how to add values to an array in laravel

$array = array('foo' => 'bar');

$array = array_add($array, 'key', 'value');
Posted by: Guest on September-02-2020
0

laravel return a single dimensional array

$catcount    = 2;
    $parents_ids = [];
    for ($i = 0; $i < $catcount; $i++) {
        $parents_ids[] = $userCategory[$i];
    }
    $subCats = Category::whereIn('parent_id', $parents_ids)->pluck('id');
Posted by: Guest on July-31-2020

Code answers related to "add array elements in laravel"

Browse Popular Code Answers by Language