Skip to content

Call to a member function get() on null #82

Description

@MazzMazz

Specs:
Laravel 7.x
Nova 3.x

Problems

When upgrading the Plugin to Version 1.1.x we get the following Exception.
We downgraded again to 1.0.11 with which everything works as expected.

{
    "message": "Call to a member function get() on null",
    "exception": "Error",
    "file": "{{pathToProject}}/vendor/dillingham/nova-attach-many/src/Http/Controllers/AttachController.php",
    "line": 46,
    "trace": [
        {
            "file": "{{pathToProject}}/vendor/dillingham/nova-attach-many/src/Http/Controllers/AttachController.php",
            "line": 30,
            "function": "getAvailableResources",
            "class": "NovaAttachMany\\Http\\Controllers\\AttachController",
            "type": "->"
        },
        {
            "file": "{{pathToProject}}/vendor/laravel/framework/src/Illuminate/Routing/Controller.php",
            "line": 54,
            "function": "edit",
            "class": "NovaAttachMany\\Http\\Controllers\\AttachController",
            "type": "->"
        },
        {
            "file": "{{pathToProject}}/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php",
            "line": 45,
            "function": "callAction",
            "class": "Illuminate\\Routing\\Controller",
            "type": "->"
        },

This happens in Version 1.1.1 and 1.1.0

Nova Resource Part

AttachMany::make(Tag::$singularLabel, 'tags', Tag::class)
                ->fullWidth()
                ->showPreview()
                ->height('200px')
                ->help('A Hint for the user.')
                ->showCounts()
                ->hideFromIndex(),

Eloquent Relation Part

public function tags(): BelongsToMany
    {
        return $this->belongsToMany(
            Tag::class,
            'b2b_product_tag_mapping',
            'product_id',
            'tag_id')->withTimestamps();
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions