We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The hidden attributes do not show the attributes where user try to show the model as json format.
It's actually made from the model property like this
class UserModel extens Model { /** * The hidden attributes * * @var array */ protected array $hidden = [ "created_at", "updated_at", ];
For this cas the hidden attributes should be made programmaticaly.
$user->setHiddenAttributes(["password"]);
The short code for implementing the method:
/** * Set the hidden attributes * * @param array $attributes */ public function setHiddenAttributes(array $attributes) { $this->hidden = array_merge($this->hidden, $attributes); }
The text was updated successfully, but these errors were encountered:
papac
No branches or pull requests
The hidden attributes do not show the attributes where user try to show the model as json format.
It's actually made from the model property like this
For this cas the hidden attributes should be made programmaticaly.
The short code for implementing the method:
The text was updated successfully, but these errors were encountered: