Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Annotated Laravel Package

cycle/annotated

Define Cycle ORM entities and schema using PHP 8 attributes. Annotate columns, primary keys, enums, decimals, and relationships like HasOne, HasMany, and BelongsTo, then let Cycle build the mapping from your code.

View on GitHub
Deep Wiki
Context7
v4.6.0

What's Changed

Full Changelog: https://github.com/cycle/annotated/compare/v4.5.0...v4.6.0

v4.5.0

What's Changed

Full Changelog: https://github.com/cycle/annotated/compare/v4.4.1...v4.5.0

v4.4.1

What's Changed

New Contributors

Full Changelog: https://github.com/cycle/annotated/compare/v4.4.0...v4.4.1

v4.4.0

What's Changed

Full Changelog: https://github.com/cycle/annotated/compare/v4.3.1...v4.4.0

v4.3.1

What's Changed

New Contributors

Full Changelog: https://github.com/cycle/annotated/compare/v4.3.0...v4.3.1

v4.3.0

What's Changed

New Contributors

Full Changelog: https://github.com/cycle/annotated/compare/v4.2.5...v4.3.0

v4.2.5

What's Changed

Full Changelog: https://github.com/cycle/annotated/compare/v4.2.4...v4.2.5

v4.2.4

What's Changed

Full Changelog: https://github.com/cycle/annotated/compare/v4.2.3...v4.2.4

v4.2.3

What's Changed

New Contributors

Full Changelog: https://github.com/cycle/annotated/compare/v4.2.2...v4.2.3

v4.2.1

What's Changed

Full Changelog: https://github.com/cycle/annotated/compare/v4.2.0...v4.2.1

v4.2.0

What's Changed

New Contributors

Full Changelog: https://github.com/cycle/annotated/compare/v4.1.0...v4.2.0

v4.1.0

What's Changed

Full Changelog: https://github.com/cycle/annotated/compare/v4.0.0...v4.1.0

v3.5.0
v4.0.0

What's Changed

Full Changelog: https://github.com/cycle/annotated/compare/v3.4.0...v4.0.0

v3.4.0

What's Changed

Foreign Key declaration via attributes

Now, you can easily define foreign keys in your entity classes using attributes, without needing any relation definitions.

How It Works:

  1. Define Entities using the #[Entity] attribute. For example, a User entity can be created with an ID as the primary key.

    use Cycle\Annotated\Annotation\Entity;
    use Cycle\Annotated\Annotation\Column;
    
    #[Entity]
    class User
    {
        #[Column(type: 'primary')]
        public int $id;
    }
    
  2. Set up Foreign Keys in two ways:

  • Directly on Properties: You can annotate a property in your class to indicate it's a foreign key related to another entity.

    use Cycle\Annotated\Annotation\Entity;
    use Cycle\Annotated\Annotation\ForeignKey;
    
    #[Entity]
    class Post
    {
        // ...
        #[Column(type: 'integer')]
        #[ForeignKey(target: User::class, action: 'CASCADE')]
        private int $userId;
    }
    
  • Or, on the Class Itself: Alternatively, you can place the foreign key annotation at the class level, specifying details like which property in your class is the foreign key (innerKey), and which property in the related class it corresponds to (outerKey).

    use Cycle\Annotated\Annotation\Entity;
    use Cycle\Annotated\Annotation\ForeignKey;
    
    #[Entity]
    #[ForeignKey(target: User::class, innerKey: 'userId', outerKey: 'id', action: 'CASCADE')]
    class Post
    {
        // ...
        #[Column(type: 'integer')]
        private int $userId;
    }
    

Full Changelog: https://github.com/cycle/annotated/compare/v3.3.1...v3.4.0

v3.3.1

What's Changed

Full Changelog: https://github.com/cycle/annotated/compare/v3.3.0...v3.3.1

v3.3.0

What's Changed

Full Changelog: https://github.com/cycle/annotated/compare/v3.2.1...v3.3.0

v3.2.1

What's Changed

  • Fix that the JTI parent has fields from children by @msmakouz in #65 thx @kastahov for tests in #64
  • Add smallInteger type hint to the Column attribute by @gam6itko in #52
  • Extend supporting for doctrine/annotations to version 2.0 by @msmakouz in #66
  • Fix bug #54 when children were not added on using attributes without dockblock by @makedo in #55

New Contributors

Full Changelog: https://github.com/cycle/annotated/compare/v3.2.0...v3.2.1

v3.2.0

What's Changed

Full Changelog: https://github.com/cycle/annotated/compare/v3.1.0...v3.2.0

v3.1.0

What's Changed

  • Add test cases related to different relation field definitions by @roxblnfk (#44)
  • Add prefix parameter to Embedded by @msmakouz (#46)
  • Add Foreign Keys for JTI by @msmakouz in (#43)
  • Fix comment to the Column field 'typecast' by @roquie (#49)
  • Fix error related with morphKey default value by @roxblnfk in (#50)

New Contributors

Full Changelog: https://github.com/cycle/annotated/compare/v3.0.0...v3.1.0

v3.0.0

What's Changed

New Contributors

Full Changelog: https://github.com/cycle/annotated/compare/v2.3.1...v3.0.0

v2.4.1
  • Fix STI configuration via attributes (#37)
v2.4.0
  • Added the scope parameter in the Entity attribute (#27)
v2.3.1
  • Fix property parameter of the Column attribute/annotation (#18)
v2.3.0
  • Added new annotations syntax and PHP attributes support (#17)
v2.2.0
  • Add supporting of orderBy option in relations (#15)
v2.1.0
  • Bump spiral dependecy to 2.7
v2.0.7

Upgrade composer PHP version

v2.0.6
  • updated to recent Doctrine/Infector API continued
v2.0.5
  • updated to recent Doctrine/Infector API
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor