Code Monkey home page Code Monkey logo

blueprint-macro's People

Contributors

dependabot[bot] avatar devmsh avatar github-actions[bot] avatar lucasvdh avatar nasrulhazim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

blueprint-macro's Issues

Naming convention

Hi!

Today I was wondering why I repeat using

$table->unsignedInteger('user_id');
$table->foreign('user_id')->references('id')->on('users');

nested of using somthing like

$table->belongsTo('user');

Once I google "Laravel blueprint macro" your fresh package appear on the first search results :D

I like the developed features, and it seems that you still work on the documentation of the available features and macros.

I would like to contribute on this package if you have any further plan, and the first thing I think about is to use the same naming convention from Eloquent to deal with relations as I mention in my previous example. It will be more familiar for the developers to use "belongsTo" both in models and migrations for example.

I'm the first to watch the repo, and I hope to be the first to contribute based on your response and ideas

nullable morph relation

What about support nullable morph relation?

currently the community overcome this using

$table->string('parent_type')->nullable();
$table->integer('parent_id')->unsigned()->nullable();

$table->index(['parent_type', 'parent_id']);

we can support that using nullableMorphs macro?

boolean values and timestamps

As we use belongsTo from the standard Laravel Eloquent methods, I think we need to use timestamps nested of using boolean values:

for example addAcceptance must only use

$this->datetime($value . '_at')->nullable();

nested of using

$this->boolean('is_' . $value)->default(false);
$this->datetime($value . '_at')->nullable();

the is_ is just a computed prop that check if _at is null or not?

the same for expired marco?

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.