user

Yasen Sayed

22 Feb 2022

How I can exclude private property from var_dump or object?

Laravel

Basically, I am using PHP Laravel and creating a new package, I like to exclude private properties from the object or dd.

Anyone can help me?

Please look at the below screenshot.

Comments

Mohamed Atef

22 Feb 2022

githubgithubgithub

You can add it to $hidden array inside the module like this 

 protected $hidden = [
 'password',
 'remember_token',
 ];

Replies

Yasen Sayed

22 Feb 2022

I will try it tomorrow but, I create a custom eloquent like the one created in Laravel.

 

© 2024 Copyrights reserved for web-brackets.com