Skip to content

Call to a member function columns() on null when added validate to controllers #476

@mansourcodes

Description

@mansourcodes

I have this draft file for laravel Blueprint that works fine,

but showing an error when added the comments lines of validate: status,amount,user_id or validate: payment

models:
  Models\Subscription:
    source: string:400
    start_date: date
    end_date: date
    user_id: id foreign:users.id
    payment_id: id foreign:payments.id
    softDeletes: true
    timestamps: true

  Models\Payment:
    status: string
    amount: decimal:8,3
    user_id: id foreign:users.id
    softDeletes: true
    timestamps: true

controllers:
  Subscription:
    resource: index,show

  Telegram:
    resource: all

  Payment:
    create:
      render: payment.create
    store:
      #   validate: status,amount,user_id
      save: payment
      fire: NewPayment with:payment
      send: PaymentCreated to:payment.user with:payment
      flash: message
      redirect: payment.create

  Api\Payment:
    store:
      # validate: payment
      save: payment
      respond: 204

Error:
Screen Shot 2021-05-17 at 2 42 14 AM

StackOverflow question:
https://stackoverflow.com/questions/67562499/laravel-blueprint-shows-error-when-added-validate-to-controller

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpendingThis issue is pending review

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions