lara-zeus / bolt

form builder for your users, with so many use cases
https://larazeus.com/bolt
MIT License
186 stars 32 forks source link

[Feature] Add getQuery Method #277

Closed mohaphez closed 6 months ago

mohaphez commented 6 months ago

Caution: This may result in breaking changes in certain programs.

what-the-diff[bot] commented 6 months ago

PR Summary

mohaphez commented 6 months ago

I also introduced the Collection data type, enabling users to utilize data as a collection. For instance, a list of items from an enum can be utilized as a feed.

public function getQuery(): Builder|Collection
{
    return collect(LanguageEnum::getAllValuesWithLabel());
}
atmonshi commented 6 months ago

thank you @mohaphez, really appreciate your work

what if we implement the getQuery to the DataSourceContract so there wont be any breaking changes, I think :) can you test that.

thank you again.

mohaphez commented 6 months ago

Hi dear @atmonshi,

You're absolutely right! That's an excellent point. I've removed getQuery from ZeuseDataSource.stub and added it to DataSourceContract. Additionally, I've replaced getModel with getQuery in getCollectionsValuesForResponse within FieldsContract.

Thanks.