Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Mago Laravel Package

carthage-software/mago

Mago is an extremely fast PHP linter, formatter, and static analyzer written in Rust. It brings Rust-inspired speed and reliability to PHP projects with a modern toolchain and great developer experience, plus multiple install options (script, Homebrew, Composer).

View on GitHub
Deep Wiki
Context7

title: The formatter

Mago's formatter ✨

Mago's formatter is a powerful, opinionated code formatter for PHP that ensures your entire codebase adheres to a single, consistent style.

Its primary goal is to end debates over code style. By automating the formatting process, it allows you and your team to stop worrying about whitespace and focus on what truly matters: building great software.

How it works

Mago takes a "parse-and-reprint" approach, inspired by modern formatters like Prettier and rustfmt.

  1. It first parses your PHP code into a detailed Abstract Syntax Tree (AST).
  2. It then throws away your original formatting, including all newlines, spacing, and indentation.
  3. Finally, it reprints the AST from scratch according to its own set of consistent, PER-CS-compliant rules.

This process guarantees that the output is always 100% consistent, regardless of the input style. Most importantly, it does this without ever changing the behavior of your code.

Key features

  • Blazing fast — Written in Rust for maximum performance, making it one of the fastest PHP formatters available.
  • Opinionated & consistent — Ends style debates by enforcing a single, unified coding style across your entire project.
  • PER-CS compliant — Follows the widely accepted PER-CS coding standard.
  • Safe — The formatter is designed to never alter the runtime behavior of your code.

Dive in

  • Usage: learn how to run the formatter from the command line.
  • Format Ignore: learn how to selectively disable formatting for files, regions, or individual statements.
  • Configuration reference: see all the available options to customize the formatter's behavior.
  • Command reference: a detailed guide to the mago format command and its flags.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport