cleaniquecoders / blueprint-macro Goto Github PK
View Code? Open in Web Editor NEWLaravel Blueprint Macro
License: MIT License
Laravel Blueprint Macro
License: MIT License
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
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?
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.