Skip to content

Conversation

@jasonmccreary
Copy link
Collaborator

@jasonmccreary jasonmccreary commented Nov 13, 2025

After presenting Blueprint at Laracon AU 2025 an attendee suggested a no-brainer feature - the ability to register custom shorthands.

This would be incredibly useful for teams that have a common set of columns or statements they define for models or controllers. It also aligns with Blueprint's type less, generate more motto.

Here's an example of registering a custom shorthand.

$blueprint = resolve(Blueprint::class);
$blueprint->registerShorthand('customShorthand', function ($indent) {
    return $indent . 'expanded: definition';
});

For now, the YAML returned from the callback must be complete. That is, it can not contain any shorthands. When returning multiple lines, be sure to indent each one.

@jasonmccreary jasonmccreary merged commit ba8bd99 into master Nov 13, 2025
21 checks passed
@jasonmccreary jasonmccreary deleted the custom-shorthands branch November 20, 2025 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants