Skip to content

Controller namespace causing some errors #116

@kallepyorala

Description

@kallepyorala

I created API controller with same kind of syntax than in Laracast example and there are couple of namespacing errors.

draft.yaml used:

models:
  Contact:
    name: string:100
    email: string:255
    phone: nullable string:50
    message: text
    replied_at: nullable timestamp
    reply: nullable text
controllers:
  Api\Contact:
    store:
      validate: name, email, phone, message
      save: contact
      send: ContactNotification to:user with:contact
      fire: NewContact with:contact
      respond: 204

Errors:

  • In controller model is referenced use App\Api\Contact; but it should be use App\Contact;
  • In Feature test request is referenced \App\Http\Requests\ContactStoreRequest::class but it should be \App\Http\Requests\Api\ContactStoreRequest::class
  • routes/web.php ContactController => Api\ContactController

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions