protonemedia / laravel-cross-eloquent-search

Laravel package to search through multiple Eloquent models. Supports sorting, pagination, scoped queries, eager load relationships and searching through single or multiple columns.
https://protone.media/blog/search-through-multiple-eloquent-models-with-our-latest-laravel-package
MIT License
1.09k stars 80 forks source link

Add Model Identifer to search results #42

Closed mrkalmdn closed 2 years ago

mrkalmdn commented 2 years ago

Hi, @pascalbaljet!

This PR is related to issues #5 and #41. I have added an includeModelIdentifer method to add an identifier to the search results.

assoft commented 2 years ago

Thank you @mrkalmdn

Absolutely i need this...

Right now I'm getting this by manipulating the data.

Surely it would be cool to have something like this internally. Hopefully it will be merged soon.

mrkalmdn commented 2 years ago

Thank you, @assoft! 🍻

pascalbaljet commented 2 years ago

Thanks @mrkalmdn! This is now available in v2.6.0, but I renamed the method to includeModelType, and you can customize the key :)

mrkalmdn commented 2 years ago

Thank you, @pascalbaljet! 🍻