Skip to content
New issue

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

Add support for Laravel-style relations #167

Merged
merged 66 commits into from
Oct 9, 2024

Commits on Feb 19, 2024

  1. Configuration menu
    Copy the full SHA
    cbaa2e5 View commit details
    Browse the repository at this point in the history
  2. Discard filesystem test case.

    We shouldn't test completely third-party code.
    bennothommo committed Feb 19, 2024
    Configuration menu
    Copy the full SHA
    8412881 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f2c68ce View commit details
    Browse the repository at this point in the history

Commits on Feb 22, 2024

  1. Remove unneeded relation class.

    We no longer extend this class, and it doesn't seem to provide any functionality anyway.
    bennothommo committed Feb 22, 2024
    Configuration menu
    Copy the full SHA
    49949fa View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    80a853a View commit details
    Browse the repository at this point in the history
  3. Move performDeleteOnRelations method into HasRelationship concern

    This method is strictly a relationship method and should be grouped with the other relationship methods.
    bennothommo committed Feb 22, 2024
    Configuration menu
    Copy the full SHA
    a79bbb4 View commit details
    Browse the repository at this point in the history
  4. Significantly refactor relation construction.

    In order to maintain some semblance of parity with Laravel, we'll now use Laravel's relation constructors and simply overwrite the "new" relation methods to create Winter's relation instances.
    
    Winter's relation name and defined constraints functionality will now be called in our own handler after the relation has been instantiated. This will allow us to review the relation directly before any Winter code runs.
    bennothommo committed Feb 22, 2024
    Configuration menu
    Copy the full SHA
    6c5c7ad View commit details
    Browse the repository at this point in the history
  5. Add ability to define relations (through methods) as dependent.

    This allows people using the relation method format to define the "delete" attribute available to relation definition arrays.
    bennothommo committed Feb 22, 2024
    Configuration menu
    Copy the full SHA
    55f03dc View commit details
    Browse the repository at this point in the history
  6. Fix Stan issue

    bennothommo committed Feb 22, 2024
    Configuration menu
    Copy the full SHA
    e8e093a View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    583051b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    173c752 View commit details
    Browse the repository at this point in the history

Commits on Feb 23, 2024

  1. Configuration menu
    Copy the full SHA
    39453b1 View commit details
    Browse the repository at this point in the history
  2. Shore up API, strengthen types, remove validation method

    The "validateRelationArgs" method does a whole lot of nothing - the most it does is enforce required parameters. These can be picked up in Laravel anyway.
    bennothommo committed Feb 23, 2024
    Configuration menu
    Copy the full SHA
    ce5ddf0 View commit details
    Browse the repository at this point in the history
  3. Minor

    bennothommo committed Feb 23, 2024
    Configuration menu
    Copy the full SHA
    8594a13 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7fd53cd View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    426a2d4 View commit details
    Browse the repository at this point in the history
  6. Add attachment tests

    bennothommo committed Feb 23, 2024
    Configuration menu
    Copy the full SHA
    cd3e791 View commit details
    Browse the repository at this point in the history
  7. Fix attachment relations

    Added the ability to define the field name and use this as a constraint for attachment relations, separating it from the relation name.
    bennothommo committed Feb 23, 2024
    Configuration menu
    Copy the full SHA
    ee17333 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    8a2d88e View commit details
    Browse the repository at this point in the history
  9. Fix Stan issue

    bennothommo committed Feb 23, 2024
    Configuration menu
    Copy the full SHA
    c9414e1 View commit details
    Browse the repository at this point in the history

Commits on Feb 26, 2024

  1. Rename MigratesForTest class

    The "Test" suffix might inadvertently be picked up by PHPUnit as a test case.
    bennothommo committed Feb 26, 2024
    Configuration menu
    Copy the full SHA
    b93e935 View commit details
    Browse the repository at this point in the history
  2. Move Sortable trait tests

    bennothommo committed Feb 26, 2024
    Configuration menu
    Copy the full SHA
    d4c1191 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3ac262d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    bdc3849 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a84b1a2 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    19b3f1a View commit details
    Browse the repository at this point in the history

Commits on Feb 27, 2024

  1. Fix soft deletion

    bennothommo committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    a2b12e5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    06f7b69 View commit details
    Browse the repository at this point in the history

Commits on Mar 25, 2024

  1. Configuration menu
    Copy the full SHA
    0c2e944 View commit details
    Browse the repository at this point in the history

Commits on Mar 28, 2024

  1. Merge branch 'fix-through-relations' into wip/laravel-style-relations

    Also add ability to define relations as "counted" relations only.
    bennothommo committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    2bde984 View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2024

  1. Configuration menu
    Copy the full SHA
    0204a0c View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2024

  1. Configuration menu
    Copy the full SHA
    8337ae7 View commit details
    Browse the repository at this point in the history
  2. Fix count-only relations.

    When using the Laravel style relation method and countOnly flag, it was not applying the constraint automatically.
    bennothommo committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    e0e4676 View commit details
    Browse the repository at this point in the history
  3. Fix definition

    bennothommo committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    1137eb5 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c82a43f View commit details
    Browse the repository at this point in the history
  5. Fix Stan issues

    bennothommo committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    3fcb603 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c4abef8 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    46778f5 View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2024

  1. Configuration menu
    Copy the full SHA
    11064ed View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4d1d1d4 View commit details
    Browse the repository at this point in the history
  3. Update src/Database/Relations/BelongsToMany.php

    Co-authored-by: Luke Towers <[email protected]>
    bennothommo and LukeTowers authored Jul 30, 2024
    Configuration menu
    Copy the full SHA
    192b47d View commit details
    Browse the repository at this point in the history
  4. Update src/Database/Relations/BelongsToMany.php

    Co-authored-by: Luke Towers <[email protected]>
    bennothommo and LukeTowers authored Jul 30, 2024
    Configuration menu
    Copy the full SHA
    57c22ba View commit details
    Browse the repository at this point in the history
  5. Update src/Database/Relations/BelongsToMany.php

    Co-authored-by: Luke Towers <[email protected]>
    bennothommo and LukeTowers authored Jul 30, 2024
    Configuration menu
    Copy the full SHA
    9d6b829 View commit details
    Browse the repository at this point in the history
  6. Update src/Database/Relations/BelongsToMany.php

    Co-authored-by: Luke Towers <[email protected]>
    bennothommo and LukeTowers authored Jul 30, 2024
    Configuration menu
    Copy the full SHA
    2951b5c View commit details
    Browse the repository at this point in the history
  7. Update src/Database/Relations/BelongsToMany.php

    Co-authored-by: Luke Towers <[email protected]>
    bennothommo and LukeTowers authored Jul 30, 2024
    Configuration menu
    Copy the full SHA
    248397b View commit details
    Browse the repository at this point in the history
  8. Update src/Database/Model.php

    Co-authored-by: Luke Towers <[email protected]>
    bennothommo and LukeTowers authored Jul 30, 2024
    Configuration menu
    Copy the full SHA
    500c32b View commit details
    Browse the repository at this point in the history
  9. Update src/Database/Relations/BelongsToMany.php

    Co-authored-by: Luke Towers <[email protected]>
    bennothommo and LukeTowers authored Jul 30, 2024
    Configuration menu
    Copy the full SHA
    e48418b View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    abcf7ee View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2024

  1. Configuration menu
    Copy the full SHA
    49d581d View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2024

  1. Configuration menu
    Copy the full SHA
    90adf97 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9840073 View commit details
    Browse the repository at this point in the history
  3. Fix Stan issues

    bennothommo committed Aug 16, 2024
    Configuration menu
    Copy the full SHA
    dd78973 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5f6eb37 View commit details
    Browse the repository at this point in the history

Commits on Sep 2, 2024

  1. Use alternative method for defining soft deletable relations

    Instead of extending the Relation class, we will make the soft delete methods available immediately to the relations.
    
    However, you can only *enable* soft delete if the related model uses the soft delete trait, thereby ensuring the correct soft delete functionality is available to the model when required.
    bennothommo committed Sep 2, 2024
    Configuration menu
    Copy the full SHA
    9b056bf View commit details
    Browse the repository at this point in the history
  2. Stan fixes

    bennothommo committed Sep 2, 2024
    Configuration menu
    Copy the full SHA
    267187b View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2024

  1. Configuration menu
    Copy the full SHA
    fe2fdec View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    eb815a9 View commit details
    Browse the repository at this point in the history
  3. Stan fix

    bennothommo committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    f8ee9d7 View commit details
    Browse the repository at this point in the history

Commits on Oct 8, 2024

  1. Fix infinite loop, improve support for dynamic Laravel relations, imp…

    …rove performance
    
    To prevent a particular infinite loop, we need to define the Relation type when using the Relation attribute for a method so that we don't have to instantiate the relation in order to find out what type it is.
    bennothommo committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    2c8972b View commit details
    Browse the repository at this point in the history
  2. Stan fix

    bennothommo committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    bbddb54 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9867c26 View commit details
    Browse the repository at this point in the history
  4. Minor

    bennothommo committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    13e66cf View commit details
    Browse the repository at this point in the history
  5. Detect relation conflicts

    When a relation is defined in both the relation properties and as a method with the same name, an exception will be thrown.
    bennothommo committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    55603fc View commit details
    Browse the repository at this point in the history
  6. Fix code smell

    bennothommo committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    0775c36 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    98a2247 View commit details
    Browse the repository at this point in the history
  8. Fix tests

    bennothommo committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    7a875c8 View commit details
    Browse the repository at this point in the history