Skip to content
Nasrul Hazim Bin Mohamad edited this page Jun 14, 2018 · 2 revisions

Macro enabled you to extend the functionality of a class. In this case, we're extending Blueprint, to ensure the readability and standardisation of data type used across the application.

Developers don't need to know much on what data type they should use - for instance, if a developer want to add a column to check on either the account is activated or not, developers can simply define the migration as following:

$table->is('activated', false); // the column name will be is_activated, data type of boolean and by default is false

The Blueprint Macro package simply categorised the data type by it's own category:

  1. Foreign Key
  2. Identifier
  3. Short String
  4. Long String
  5. Acceptance
  6. Money
  7. Misc.
Clone this wiki locally