- Eloquent
- Doctrine ORM
- Django
- Other
Disclaimer: When building complex apps, I often forget the order of keys in Belongs To Many and Has Many Through relationships. Initially, someone (whom I unfortunately do not know) created a similar app at https://rel.uonick.com/. Unfortunately, it is no longer available, so I rebuilt it and included all possible Eloquent relationships.
Relationships Builder designed to facilitate the creation of Eloquent, Doctrine, Django relationships in your applications.
Built with Vue 3, Vuetify, and TypeScript, this dynamic web interface provides a user-friendly environment to define and customize relationships like hasOne
, hasMany
, belongsTo
, morphToMany
, and more.
- Dynamic Relationship Configuration: Easily configure various types of relationships using a user-friendly web interface.
- Support for Multiple Relationship Types: Includes
hasOne
,hasMany
,belongsTo
,belongsToMany
,hasManyThrough
,morphTo
,morphMany
, andmorphToMany
. - Interactive UI: Built with Vuetify, offering a responsive and intuitive design.
- Local and Demo Installation: Can be installed locally for development and testing or accessed via a live demo.
Check out the live demo: Relationships Builder Demo
- Node.js (I use v21.7.3)
- npm or yarn
- Laravel environment (for local installation)
-
Clone the Repository
git clone kwidoo/relation-builder.git cd relation-builder
-
Install Dependencies
npm install # or yarn install
-
Environment Setup
- Ensure your Laravel backend is setup and running.
- Configure any necessary environment variables, such as API endpoints.
-
Serve the Application
npm run dev # or yarn dev
This will compile and hot-reload for development.
By default will be available on http://localhost:3000
-
Add docker setup
docker-compose up -d
Access it:
http://localhost:3000
After installation, navigate to the main page where you can select the type of relationship you wish to configure. Fill in the required fields such as model names and keys, and the tool will dynamically generate the corresponding relationship methods.
You can choose to either include generated code in your model or, by default, download a trait and use it in your model.
You can also select a namespace, if required.
- Allow saving, editing, and deleting namespaces
- Enable the generation of default scopes
- Allow the creation of migrations
- Check syntax of stubs
- Setup strict eslint
Contributions are welcome! Please feel free to submit pull requests, or report bugs and suggest features via the issue tracker.
This project is open-sourced software licensed under the MIT license.