z-song/laravel-admin · error · InvalidArgumentException

[Class [{$selectable}] must be a sub class of Encore\Admin\G

Error message

[Class [{$selectable}] must be a sub class of Encore\Admin\Grid\Selectable

What it means

Error "[Class [{$selectable}] must be a sub class of Encore\Admin\Grid\Selectable" thrown in z-song/laravel-admin.

Source

Thrown at src/Form/Field/BelongsToRelation.php:39

     * BelongsToRelation constructor.
     *
     * @param string $column
     * @param array  $arguments
     */
    public function __construct($column, $arguments = [])
    {
        $this->setSelectable($arguments[0]);

        parent::__construct($column, array_slice($arguments, 1));
    }

    /**
     * @param string $selectable
     */
    protected function setSelectable($selectable)
    {
        if (!class_exists($selectable) || !is_subclass_of($selectable, Selectable::class)) {
            throw new \InvalidArgumentException(
                "[Class [{$selectable}] must be a sub class of Encore\Admin\Grid\Selectable"
            );
        }

        $this->selectable = $selectable;
    }

    /**
     * @return string
     */
    public function getSelectable()
    {
        return $this->selectable;
    }

    /**
     * @param int $multiple
     *

View on GitHub (pinned to 67c441eb78)

When it happens

Trigger: Thrown at src/Form/Field/BelongsToRelation.php:39 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of z-song/laravel-admin@67c441eb78 (2026-08-21). Data as JSON: /api/errors/1ebf432b588250ad. Report an issue: GitHub.