Skip to content

Boost's tinker requires explicit return statement and semicolon #445

@shortontech

Description

@shortontech

Boost Version

1.8.10

Laravel Version

12.42.0

Agent/IDE Name & Version

Claude Code 2.1.12

PHP Version

8.5.2

System Info

Ubuntu 24.04

Description

I've used skills with Claude to provoke it to use artisan tinker, and that's gone well. Anthropic's Claude Sonnet 4.5 has a lot of training data regarding how to use Tinker, so that has worked well for me.

One of the normal features of php artisan tinker is that if you use it to run a query or a function, you don't have to be explicit with a return statement, and you don't need a semicolon.

Boost's tinker requires a return statement and a semicolon to return data.

Steps To Reproduce

From the Claude Code CLI, ask it to run simple PHP code, without the semicolon.

❯ Use the mcp's tinker and see if you can execute "echo 1"

● laravel-boost - tinker (MCP)(code: "echo 1", timeout: 180)
  ⎿  {
         "error": "syntax error, unexpected end of file, expecting \",\" or \";\"",
         "type": "ParseError",
         "file": "vendor\/laravel\/boost\/src\/Mcp\/Tools\/Tinker.php(53) : eval()'d code",
         "line": 1
     }

Using the command line:

php artisan tinker --execute='echo 1'

This just prints the number 1.

Metadata

Metadata

Assignees

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