Skip to content

@pushIf with Str::startsWith() causes syntax error in Blade #57264

@hctorres02

Description

@hctorres02

Laravel Version

12.32.5

PHP Version

8.2.29

Database Driver & Version

No response

Description

When using @pushIf in a Blade template with Str::startsWith(), a syntax error occurs:

syntax error, unexpected token ":"

This happens even when the arguments to Str::startsWith() are valid strings. Using the str() helper with startsWith() works fine.

Steps To Reproduce

Get error:

@pushIf(Str::startsWith('abc', 'a'), 'body-end')
    // ...
@endPushIf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions