GithubHelp home page GithubHelp logo

Comments (8)

jasonmccreary avatar jasonmccreary commented on September 28, 2024

The standard belongsTo relationship is supported for v1.

I still want Blueprint to generate additional relationships like the corresponding hasOne relationship, as well as hasMany. But I'm want to determine a streamlined syntax for the latter as well as supporting existing models.

As such, retagging this for post v1.

from blueprint.

MattHadfield113 avatar MattHadfield113 commented on September 28, 2024

Is there any ETA on this, as this is the only thing stopping me from using this on a large project ?

from blueprint.

jasonmccreary avatar jasonmccreary commented on September 28, 2024

@MattHadfield113, what exactly are you waiting on?

from blueprint.

MattHadfield113 avatar MattHadfield113 commented on September 28, 2024

@jasonmccreary the syntax and ways for generating a hasMany or hasOne relationship, as those are quite critical to most projects with relational data and would be great to have them premade rather than generating all the models then having to edit them to add the hasMany or hasOne relationships after the fact.

from blueprint.

jasonmccreary avatar jasonmccreary commented on September 28, 2024

@MattHadfield113, you do realize right now you're writing everything manually. So Blueprint still provides a lot of value. Seems knee-jerk to have this single item stop you from using it.

I welcome any syntax suggestions or PRs for adding this. Otherwise, there's no ETA.

This is on the list, just don't know when I'll come back to it as nested namespaces and test generation are my priorities at the moment.

from blueprint.

MattHadfield113 avatar MattHadfield113 commented on September 28, 2024

@jasonmccreary im currently using https://github.com/pipe-dream/laravel-create instead, which does quite a bit of the work, however Blueprint takes this a whole step further. Very excited to see this in full swing.

from blueprint.

jasonmccreary avatar jasonmccreary commented on September 28, 2024

The beginnings of this were merged in PR #72 and will be tagged shortly.

from blueprint.

XhaDgr8 avatar XhaDgr8 commented on September 28, 2024

i just want to make this work :
models:
Product:
user_id: id foreign:users.id
slug: string:400 unique
name: string:400
description: longtext
status: string:400 default:draft
variable: booleon default:true
relationships:
belongsTo: Category
belongsToMany: Order
hasMany: Variant, Review
morphOne: Price, Meta

morphToMany: Media, Tag

Price:
user_id: id foreign:users.id
price: integer dafault:0
compare_at_price: integer default:0
cost_price: integer dafault:0
shipping_price: integer dafault:0
tax: integer dafault:0
relationships:
morphTo: Product, Variant

Variant:
user_id: id foreign:users.id
product_id: id foreign:products.id
option: string:400
value: string:400
display: string:400
relationships:
belongsTo: Product
morphOne: Price, Meta

morphToMany: Media, Tag

Meta:
user_id: id foreign:users.id
seo_title: string:400
seo_description: longText
relationships:
morphTo: Product, Variant, Category, Blog

morphToMany: Media

Tag:
user_id: id foreign:users.id
name: string:400 unique
relationships:

morphedByMany: Product, Category, Blog

Media:
user_id: id foreign:users.id
url: string:400
alt: string:400
type: string:400
relationships:

morphedByMany: Product, Variant, Category, Blog, Meta, Review

Order:
slug: string:400 unique
user_id: id foreign:users.id
transaction_id: string:400
total: integer dafault:0
status: string:400 default:draft
description: longText nullable
relationships:
belongsTo: User
hasOne: Address
hasMany: Products

Address:
user_id: id foreign:users.id
order_id: id foreign:orders.id nullable
primary: boolean default:false
country: string:400
street_line_1: string:400
street_line_2: string:400 nullable
city: string:400
state: string:400
zip_code: string:400
relationships:
belongsTo: Order

Review:
user_id: id foreign:users.id
product_id: id foreign:products.id
content: longtext
star: integer dafault:0

Category:
slug: string:400 unique
user_id: id foreign:users.id
product_id: id foreign:products.id
name: string:400
description: longText
relationships:
morphOne: Meta
hasMany: Product

Blog:
slug: string:400 unique
user_id: id foreign:users.id
name: string:400
content: longText
relationships:
belongsTo: User
morphOne: Meta

morphToMany: Media, Tag

controllers:
Omni:
resource
Product:
resource
Category:
resource
Blog:
resource
but as soon as I run blueprint:build it returns this:

pa blueprint:build

ErrorException

Undefined index: morphtomany

from blueprint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.