Skip to content
Advertisement

Access value of array inside another array [closed]

I have an array an it is as follows as a result of dd().

dd($request->user['test'])

-result of dd()

  array:4 [
      "id" => 1
      "name" => "Test1"
      "created_at" => "2016-02-21 23:05:43"
      "updated_at" => "2016-02-21 23:05:43"
    ]

how can I access ‘name’ indide above array.

Advertisement

Answer

Try like this.

dd($request->user['test']['name']);
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement