laravel-shift/blueprint

Model attribute called `cast` is being double-quoted in generated code

GingertronMk1 opened this issue · 2 comments

  • Laravel Version: 10.10
  • PHP Version: 8.2.6
  • Blueprint Version: 2.7
  • Platform: Mac

Issue:

I have a pre-existing model called Show, which has as an attribute an array called cast.
When I use blueprint to generate a web resource for this model it double-quotes the word cast in the requests and tests generated.
See below for examples.

'"cast"' => ['required', 'json'],
->where('"cast"', $"cast")
'"cast"' => $"cast",

draft.yaml:

models:
  # ...

controllers:
  # ...
    Show:
        resource: web
    Person:
        resource: web

Please complete the issue template as requested by including the relevant models section (i.e. the model with casts field.

I am not able to replicate this in the current version of Blueprint. It's possible there might be an issue with blueprint:trace on certain database types. But I tested with a cast JSON column on both SQLite and MySQL.

If you can reproduce this error on the latest version of Blueprint, please comment back with the contents of your .blueprint file.