laravel-shift / blueprint

A code generation tool for Laravel developers.
MIT License
2.86k stars 273 forks source link

A colon cannot be used in an unquoted mapping value #647

Closed MosetiReagan closed 1 year ago

MosetiReagan commented 1 year ago

Issue:

A colon cannot be used in an unquoted mapping value at line 32 (near " error: "/generate-certificate"").

draft.yaml:

routes:
  - url: /generate-certificate
  - controller: CertificateController@index
  - methods:
      - GET
      - POST

models:
  Certificate:
    first_name:
      type: string
      length: 100
    last_name:
      type: string
      length: 100
    template:
      type: string
      length: 100

controllers:
  - name: CertificateController
    resource: true
    requests: true
    methods:
      - name: index
        action: fetch
        view: certificates.index
      - name: generate
        action: create
        redirect:
          success: "/success"
          error: "/generate-certificate"

views:
  - name: certificates.index
    path: resources/views/certificates/index.blade.php
    sections:
      - name: content
        content: "Placeholder text here without HTML"

  - name: success
    path: resources/views/success.blade.php
    sections:
      - name: content
        content: "Placeholder text here without HTML"

requests:
  - StoreCertificateRequest
  - first_name
  - last_name
  - template

migrations: true

factories: true

tests: true
jasonmccreary commented 1 year ago

The syntax you have for redirect: is incorrect. It only accepts a string/reference, not an array. If you want such a syntax, feel free to open a PR.