Mahmoud Ramadan

Easy Model - A Laravel package for enjoyably managing database queries

by•
This release brings cleaner exception handling, smarter relationship ordering, advanced keyword search helpers, array-driven where conditions, better JOIN support, safer reusable pipelines, and direct single-model retrieval from the searchable pipeline. Also packed with important fixes for relationship ordering, soft delete handling, query consistency, silent row-loss issues, and pipeline stability. 🥵

Add a comment

Replies

Best
Mahmoud Ramadan
Maker
📌

🚀 New EasyModel Release

This release focuses on improving query flexibility, relationship ordering, exception handling, and overall pipeline stability across the package.

✨ Added

  • Added an EasyModelException marker interface implemented by all package exceptions for unified error handling.

  • Added named constructors to all exceptions for centralized and consistent error messages.

  • Rebases package exceptions on top of SPL exceptions (\LogicException / \InvalidArgumentException) without introducing breaking changes.

  • Added addOrderByCount() and addOrderByAggregate() helpers for ordering by relationship aggregates.

  • Added addKeywordSearch() for grouped multi-column LIKE / = searching.

  • Added array-driven helpers:

    • addWhereIn()

    • addWhereNotIn()

    • addWhereNull()

    • addWhereNotNull()

    • addWhereBetween()

  • Added first-class JOIN support in addOrderBy() for:

    • MorphOne

    • MorphMany

    • MorphToMany

    • HasOneThrough

    • HasManyThrough

  • Added flushSearchable() and flushUpdatable() to safely reset internal trait state for reusable pipelines.

  • Added support for retrieving a single model instance directly from the searchable pipeline.

🛠 Fixed

  • Fixed a reset() reference bug in prepareWhereConditions() when using arrays as where values.

  • Fixed incorrect foreign-key resolution for BelongsTo ordering.

  • Fixed silent row-loss when ordering relationships using LEFT JOIN through explicit base-table selection and JOIN deduplication.

  • Fixed missing default handling in buildQueryUsingWheres() by throwing InvalidArrayStructure.

  • Fixed setSearchableQuery() and setUpdatableQuery() silently downgrading an EloquentBuilder into a QueryBuilder.

  • Fixed includeSoftDeleted() silently doing nothing when the model does not use SoftDeletes; it now throws InvalidModel.

  • Extended the single-model update fix into the Updatable pipeline itself.

💚 This release makes EasyModel more predictable, extensible, and production-ready for complex Laravel query workflows.