{"record":{"id":"e5dbdc3ded7bca6e","repo":"filamentphp/filament","slug":"no-userclass-model-found-please-bind-an-auth-e5dbdc","errorCode":null,"errorMessage":"No [{$userClass}] model found. Please bind an authenticatable model to the [Illuminate\\Contracts\\Auth\\Authenticatable] interface in a service provider's [register()] method.","messagePattern":"No \\[(.+?)\\] model found\\. Please bind an authenticatable model to the \\[Illuminate\\\\Contracts\\\\Auth\\\\Authenticatable\\] interface in a service provider's \\[register\\(\\)\\] method\\.","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"packages/actions/src/Imports/Models/Import.php","lineNumber":79,"sourceCode":"\n    public function user(): BelongsTo\n    {\n        if (static::hasPolymorphicUserRelationship()) {\n            return $this->morphTo();\n        }\n\n        /** @var ?Authenticatable $authenticatable */\n        $authenticatable = app(Authenticatable::class);\n\n        if ($authenticatable) {\n            /** @phpstan-ignore-next-line */\n            return $this->belongsTo($authenticatable::class);\n        }\n\n        $userClass = app()->getNamespace() . 'Models\\\\User';\n\n        if (! class_exists($userClass)) {\n            throw new LogicException('No [' . $userClass . '] model found. Please bind an authenticatable model to the [Illuminate\\\\Contracts\\\\Auth\\\\Authenticatable] interface in a service provider\\'s [register()] method.');\n        }\n\n        /** @phpstan-ignore-next-line */\n        return $this->belongsTo($userClass);\n    }\n\n    /**\n     * @param  array<string, string>  $columnMap\n     * @param  array<string, mixed>  $options\n     */\n    public function getImporter(\n        array $columnMap,\n        array $options,\n    ): Importer {\n        $this->columnMap($columnMap);\n        $this->options($options);\n\n        return app($this->importer, [","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/filamentphp/filament/blob/53483fa9340e4ec637985fe454ebb58afb92ea24/packages/actions/src/Imports/Models/Import.php#L61-L97","documentation":"Filament's Import model mirrors Export: it records who ran each import through a `user()` relationship. It resolves `Illuminate\\Contracts\\Auth\\Authenticatable` from the container first, then falls back to the conventional `App\\Models\\User` class. If neither the binding nor the conventional class exists, this LogicException is thrown when the relationship is first resolved (e.g. after an `ImportAction` completes).","triggerScenarios":"Running an import in an app whose user model lives outside `App\\Models\\User` (custom namespace, separate admin model, multi-guard) with no `Authenticatable` binding registered in a service provider.","commonSituations":"Domain-structured apps (`App\\Domains\\...`), packages providing their own user models, or apps upgraded from older setups where the user class moved.","solutions":["Bind the contract in `app/Providers/AppServiceProvider.php`: `$this->app->bind(\\Illuminate\\Contracts\\Auth\\Authenticatable::class, config('auth.providers.users.model'));`","Verify `App\\Models\\User` exists and is autoloaded if that is genuinely your model.","Add the binding once in shared infrastructure instead of patching per-panel."],"exampleFix":"// before — import fails resolving the `user()` relation\nImportAction::make();\n\n// after — app/Providers/AppServiceProvider.php\nuse Illuminate\\Contracts\\Auth\\Authenticatable;\n\npublic function register(): void\n{\n    $this->app->bind(Authenticatable::class, config('auth.providers.users.model'));\n}","handlingStrategy":"validation","validationCode":"// Run before enabling import actions\nuse Illuminate\\Contracts\\Auth\\Authenticatable;\n\n$userModelResolved = app()->bound(Authenticatable::class)\n    || class_exists(app()->getNamespace() . 'Models\\\\User');\n\nif (! $userModelResolved) {\n    throw new RuntimeException(\n        'Bind Authenticatable to your user model before using imports.'\n    );\n}","typeGuard":null,"tryCatchPattern":"try {\n    return $import->user;\n} catch (LogicException $exception) {\n    log()->warning('Import user relation unavailable: ' . $exception->getMessage());\n\n    return null;\n}","preventionTips":["Share one Authenticatable binding across export and import features.","Make the binding config-driven and cover it with a smoke test that runs an export and an import.","Watch for this after moving your User model or adding a second guard."],"tags":["filament","imports","authentication","container-binding","laravel","eloquent"],"backgroundTag":"missing-authenticatable-binding","analyzedSha":"53483fa9340e4ec637985fe454ebb58afb92ea24","analyzedAt":"2026-08-17T02:06:23.049Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}