يضيف Laravel Pint علمًا بشفرة لتنسيق قوالب الشفرة الخاصة بك
قام Laravel Pint، مثبت نمط التعليمات البرمجية ذي التكوين الصفري المبني على PHP - CS - Fixer، بشحن ميزة تغلق فجوة طويلة الأمد: فهي تقوم الآن بتنسيق قوالب Blade أيضًا. Pint 1.30.0، الذي تم إصداره جنبًا إلى جنب مع إعلانات Laracon US 2026، يضيف - بلا

قام Laravel Pint، مثبت نمط التعليمات البرمجية ذي التكوين الصفري المبني على PHP - CS - Fixer، بشحن ميزة تغلق فجوة طويلة الأمد: فهي تقوم الآن بتنسيق قوالب Blade أيضًا. Pint 1.30.0، الذي تم إصداره جنبًا إلى جنب مع إعلانات Laracon US 2026، يضيف --blade العلم الذي يدير .blade.php الملفات من خلال Prettier للتنسيق المتسق، بالإضافة إلى تنسيق PHP الذي يتعامل معه Pint بالفعل.
ما كان مفقودًا من قبل
لطالما كان Pint ممتازًا في الحفاظ على اتساق PHP الخاص بك، والتباعد، والمحاذاة، وطلب الاستيراد، وكل ذلك يتم فرضه تلقائيًا دون الحاجة إلى ملف تكوين لمعظم المشاريع. ولكن في اللحظة التي فتحت فيها عرض Blade، كنت بمفردك. المسافة البادئة @if كتل، والتباعد حول التوجيهات، وتنسيق السمات على المكونات، كل ذلك يعتمد كليًا على كل ما فعله أو لم يفعله التنسيق التلقائي للمحرر.
تم الوصول إلى الفرق التي اهتمت بتنسيق Blade المتسق بشكل عام لإعداد Prettier منفصل باستخدام مكون Blade الإضافي، وتم تكوينه وصيانته خارج Pint بالكامل. وهذا يعني وجود أداتين للتنسيق، وتكوينين، ومكانين لفشل فحص واجهة التحكم.
ماذا يفعل علم النصل
./vendor/bin/pint --blade
تشغيل الباينت مع --blade تنسيقات .blade.php الملفات من خلال Prettier باستخدام الإعدادات الافتراضية المعقولة للشفرة، إلى جانب تمرير تنسيق PHP العادي. يمكنك دمجه مع خيارات باينت الحالية:
./vendor/bin/pint --blade --test
--test (أو --dry-run تقوم عمليات التحقق من النمط في CI) الآن بالإبلاغ عن مشكلات التنسيق في طرق عرض Blade الخاصة بك بنفس الطريقة التي تقوم بها بالفعل بالإبلاغ عنها لملفات PHP، لذلك يمكن أن يؤدي تشغيل Pint واحد إلى بوابة تنسيق PHP و Blade في خطوة CI واحدة.
إصلاحات أخرى في هذا الإصدار
لا يتعلق الباينت 1.30.0 فقط بدعم الشفرة. يعمل الإصدار أيضًا على إصلاح الحواف الخشنة طويلة الأمد في علامتين شائعتين الاستخدام:
--diff، مما يدل على أن الباينت سيتغير دون كتابته، ينتج الآن مخرجات أكثر موثوقية--quiet، لقمع الإخراج الطبيعي لـ Pint في سجلات CI، كان لديه حالات حافة حيث لم يكن صامتًا تمامًا، والتي تم حلها الآن
إضافته إلى خط أنابيب CI الخاص بك
إذا قمت بالفعل بتشغيل Pint في CI للتحقق من التنسيق عند طلبات السحب، فإن إضافة تغطية Blade هي تغيير من سطر واحد:
# .github/workflows/lint.yml
- name: Check code style
run: ./vendor/bin/pint --blade --test
أهمية هذه اللحظة
Blade formatting has been one of the more fragmented corners of the Laravel toolchain, every team either enforcing it manually through code review or wiring up a separate Prettier configuration that lived outside the rest of the project's linting setup. Folding it into Pint means one tool, one command, and one CI check for style across both your PHP and your views, which is a meaningful simplification for any team that cares about consistent formatting but does not want to maintain two overlapping toolchains to get it.
Laravel Pint, the zero-config code style fixer built on PHP-CS-Fixer, has shipped a feature that closes a long-standing gap: it now formats Blade templates too. Pint 1.30.0, released alongside the Laracon US 2026 announcements, adds a --blade flag that runs your .blade.php files through Prettier for consistent formatting, on top of the PHP formatting Pint already handles.
What was missing before
Pint has always been excellent at keeping your PHP consistent, spacing, alignment, import ordering, all enforced automatically with no configuration file required for most projects. But the moment you opened a Blade view, you were on your own. Indentation of nested @if blocks, spacing around directives, attribute formatting on components, all of it depended entirely on whatever your editor's auto-formatter did, or didn't do.
Teams that cared about consistent Blade formatting generally reached for a separate Prettier setup with a Blade plugin, configured and maintained outside of Pint entirely. That meant two formatting tools, two configs, and two places for a CI check to fail.
What the --blade flag does
./vendor/bin/pint --blade
Running Pint with --blade formats your .blade.php files through Prettier using sensible Blade-aware defaults, alongside the normal PHP formatting pass. You can combine it with Pint's existing options:
./vendor/bin/pint --blade --test
--test (or --dry-run style checks in CI) now reports formatting issues in your Blade views the same way it already reports them for PHP files, so a single Pint run can gate both PHP and Blade formatting in one CI step.
Other fixes in this release
Pint 1.30.0 is not only about Blade support. The release also fixes long-standing rough edges in two commonly used flags:
--diff, which shows what Pint would change without writing it, now produces more reliable output--quiet, for suppressing Pint's normal output in CI logs, had edge cases where it wasn't fully silent, which are now resolved
Adding it to your CI pipeline
If you already run Pint in CI to check formatting on pull requests, adding Blade coverage is a one-line change:
# .github/workflows/lint.yml
- name: Check code style
run: ./vendor/bin/pint --blade --test
Why this matters
Blade formatting has been one of the more fragmented corners of the Laravel toolchain, every team either enforcing it manually through code review or wiring up a separate Prettier configuration that lived outside the rest of the project's linting setup. Folding it into Pint means one tool, one command, and one CI check for style across both your PHP and your views, which is a meaningful simplification for any team that cares about consistent formatting but does not want to maintain two overlapping toolchains to get it.
عبدالرحمن ربيع
Software Engineer & AI Builder
مطور برمجيات متكامل ومصمم جرافيك مع أكثر من 4 سنوات خبرة في بناء تطبيقات الويب الحديثة باستخدام PHP و JavaScript و HTML و CSS. خلفية قوية في تصميم UI/UX واستخدام متقدم لأدوات الذكاء الاصطناعي لتعزيز كفاءة التطوير والأتمتة واتخاذ القرارات. حاصل على ماجستير تنفي...
مقالات ذات صلة
تقوم Laravel AI SDK بشحن واجهة برمجة تطبيقات بشرية في الحلقة للموافقة على مكالمات أدوات الوكيل
اقرأ المقال
باحثون من برينستون وآنت جروب وستانفورد يقدمون AQuA: إطار عمل وكيل من جزأين لاكتشاف العوامل المستقلة وتطوير النماذج في التمويل الكمي
اقرأ المقال
Alibaba Qwen Releases Qwen3.8-Omni-Flash: A 1M-Context Omni-Modal Model Built Around Agentic Audio-Video Understanding and Tool Use
اقرأ المقال
التعليقات (0)
كن أول من يعلّق على هذا المقال.