Responsive Advertisement

Get Multipal Array Data Array in Array Laravel

Array
(
    [0] => Array
        (
            [id] => 8
            [restaurant_id] => 5
            [category_id] => 1
            [deleted_at] =>
            [created_at] => 2020-08-31T08:40:58.000000Z
            [updated_at] => 2020-08-31T08:40:58.000000Z
            [categorylistdd] => Array
                (
                    [id] => 1
                    [name] => Burger
                    [image] => Burger.svg
                    [banner] =>
                    [deleted_at] =>
                    [created_at] =>
                    [updated_at] =>
                )

        )

    [1] => Array
        (
            [id] => 9
            [restaurant_id] => 5
            [category_id] => 2
            [deleted_at] =>
            [created_at] => 2020-08-31T08:44:40.000000Z
            [updated_at] => 2020-08-31T08:44:40.000000Z
            [categorylistdd] => Array
                (
                    [id] => 2
                    [name] => Desert
                    [image] => Dessert.svg
                    [banner] =>
                    [deleted_at] =>
                    [created_at] =>
                    [updated_at] =>
                )

        )


Answer : $value['categorylistdd']['name'],

you can use Also pluck in laravel 

Note: by use get->()->plucke(' Desert ')->addArray();
You will get all data of Name, Image , banner check top On

Post a Comment

0 Comments