RTippin / messenger

Laravel messenger. A full messenger suite for your new / existing laravel app! Private and group threads between multiple models, with real-time messaging, reactions, attachments, calling, chat bots, and more!
https://tippindev.com
MIT License
412 stars 79 forks source link

Messenger (USer model) fields #51

Closed vishalag991 closed 1 year ago

vishalag991 commented 1 year ago

Thanks for this wonderful package.

Currently package returns all fields of our 'User' model. This includes phone numbers etc also. How can we modify the 'Base' response object?

RTippin commented 1 year ago

Thanks! There is no easy way to completely overwrite my provider https://github.com/RTippin/messenger/blob/92cca2804e74b79319be6177083c728ca0244038/src/Http/Resources/ProviderResource.php#L71

However, if you set the $hidden property on your model, those columns will not be used when your model is serialized, including from within my package.

https://laravel.com/docs/9.x/eloquent-serialization#hiding-attributes-from-json

vishalag991 commented 1 year ago

Thanks for prompt response. Closing this issue.