Answers for "laravel array add item"

PHP
4

laravel append array to array

$arr = ["1", "2"];
array_push($arr, "3");
Posted by: Guest on September-02-2021
2

laravel insert array

$projects = [
    [
        "name"        => "project-one",
        "description" => "description",
    ],
    [
        "name"        => "project-two",
        "description" => "description",
    ],
];
Project::insert($projects);
Posted by: Guest on February-20-2022

Browse Popular Code Answers by Language