Skip to content

Wrong table name and field name format #2207

@rob1121

Description

@rob1121

Describe the bug
Expected behavior/Solution

Table name and field name should be snake_case but got camelCase

Steps to reproduce
MY VALIDATION RULES:

    public function rules(): array
    {
        return [
      'id' => [
        'required'
      ],
      'title' => [
        'required'
      ],
      'slug' => [
        'required',
        Rule::unique('collections', 'slug')->ignore($this->arg('id'), 'id'),
      ],
      'tracks' => [
        'connect' => [
        Rule::unique('collection_tracks', 'track_id')->ignore($this->arg('id'), 'collection_id'),
        ]
      ]
    ];
    }

input UpdateTracksBelongsToMany {
    connect: [ID!]
    sync: [ID!]
    syncWithoutDetaching: [ID!]
    disconnect: [ID!]
    delete: [ID!]
}

MY MUTATION:

    updateUserCollection(
        id: ID!
        title: String
        slug: String
        description: String
        public: Boolean
        tracks: UpdateTracksBelongsToMany
    ): Collection
        @validator
        @can(
            ability: "update"
            injectArgs: true
            model: "App\\Models\\Collection"
        )
        @update

Output/Logs

Click to expand
debugMessage
: 
"SQLSTATE[42S02]: Base table or view not found: 1146 Table 'audiosugar.collectiontracks' doesn't exist (SQL: select count(*) as aggregate from `collectionTracks` where `trackId` = 1 and `collectionId` <> 1)"

Lighthouse Version

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionRequest for support or clarification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions