Skip to content

Boost can't render the guideline: @model and {{ }} in core.blade.php are compiled #21

Closed

Description

@n4ff4h

Laravel Boost (v2.10) compiles each resources/boost/guidelines/*.blade.php with Blade, and fails on javaabu/forms' guideline:

Skipped 1 file that could not be rendered:
 - vendor/javaabu/forms/resources/boost/guidelines/core.blade.php

The result: apps that install javaabu/forms (the React skeleton, and every next-gen package app) get no javaabu/forms guideline in AGENTS.md/CLAUDE.md.

Cause: line 10 of resources/boost/guidelines/core.blade.php:

- Bind models with `<x-forms::form :model="$model">` or `@model($model) … @endmodel`; never set `value="{{ old(...) }}"` yourself.
  • @model … @endmodel is the package's own conditional directive, so Blade compiles it into an if with no end (syntax error, unexpected end of file, expecting "elseif" or "else" or "endif").
  • {{ old(...) }} would be echoed too.

Fix: escape both: @@model($model) … @@endmodel and @{{ old(...) }}, or wrap the file's body in @verbatim … @endverbatim. A test that runs Blade::render() on the guideline would stop it coming back.

To reproduce, in an app with javaabu/forms ^2.0@dev and laravel/boost ^2.10: run php artisan boost:update -n, or Blade::render(file_get_contents('vendor/javaabu/forms/resources/boost/guidelines/core.blade.php')).

Found by javaabu/laravel-skeleton-react. Not blocking: the skill (javaabu-forms) still installs.

Activity

  1. added
    next-genNext-gen Javaabu packages
    cross-packageRequested by or affecting another next-gen package
    on Nov 5, 2026
  2. n4ff4h commented on Nov 6, 2026

    @n4ff4h
    Author

    Fixed on next-gen in 5d05ebd and b3ad178 (PR #16). CI is green on every leg, including prefer-lowest.

    • Fix: the guideline body in resources/boost/guidelines/core.blade.php is in a @verbatim … @endverbatim block, so @model … @endmodel and {{ old(...) }} come through as written.
    • Why not @@model / @{{ }}: escaping works on laravel/boost 2.10.4, which handles Blade escapes itself, but not on 2.10.0. 2.10.0 turns each backtick into ___SINGLE_BACKTICK___ before rendering, so `@@model becomes ___@@model. Blade's directive pattern (\B@) then skips the first @ and still compiles @model. A verbatim block renders the same on every version.
    • Test: tests/Unit/BoostTest.php renders every .blade.php file under resources/boost with Boost's own RendersBladeGuidelines trait (laravel/boost ^2.10 is now in require-dev). It checks that the guideline isn't dropped and that its Blade examples come out intact. The prefer-lowest legs run it on boost 2.10.0 and the stable legs on 2.10.4.
    • Other Boost files: the skill (skills/javaabu-forms/SKILL.md, references/components.md) is Markdown, which Boost copies without rendering, so its Blade examples are safe as they are. A test checks that the guideline is the only .blade.php file there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cross-packageRequested by or affecting another next-gen packagenext-genNext-gen Javaabu packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions