Skip to content

Error Using Wayfinder #99

@likeadeckofcards

Description

@likeadeckofcards

When using wayfinder, Eloquent FileMaker will throw an error trying to generate its files.

How to trigger the generate:

php artisan wayfinder:generate

Findings

The package would use the getColumns method on the Schema Builder but the FM version does not override that method. We just directly overrode the getColumnListing method. We can update the getColumns method to map the data returned from FileMaker's layout endpoint. Then we can eliminate the getColumnListing method because the method would become the same as the underlying version.

<?php

namespace GearboxSolutions\EloquentFileMaker\Database\Schema;

class FMBuilder extends \Illuminate\Database\Schema\Builder
{
    /**
     * Get the column listing for a given table.
     *
     * @param  string  $table
     * @return array
     */
    public function getColumnListing($table)
    {
        $layoutMetaData = $this->connection->getLayoutMetadata($table);
        $fieldMetaData = $layoutMetaData['fieldMetaData'];
        $columns = array_column($fieldMetaData, 'name');

        return $columns;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions