0

I have an object of JSON data in my laravel application. When I display that variable in blade

{{$permissions}}

I get the following

Image of one row of data

How would I access the role ID?

Thanks

1
  • MachNamara, Pls post your data? Commented Aug 22, 2018 at 17:02

1 Answer 1

1

If it's a object, you just do

`$json->roles[0]->id`

if it is a string, you must decode it first so you do

$json = json_decode($string);

and then you do step 1

Sign up to request clarification or add additional context in comments.

1 Comment

Actually it will never be a JSON over PHP. Replace your first sentence by "If it's an Object, you just do" instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.