{"record":{"id":"897b50e7fee57895","repo":"filamentphp/filament","slug":"no-userclass-model-found-please-bind-an-auth","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/Exports/Models/Export.php","lineNumber":73,"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 getExporter(\n        array $columnMap,\n        array $options,\n    ): Exporter {\n        $this->columnMap($columnMap);\n        $this->options($options);\n\n        return app($this->exporter, [","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/filamentphp/filament/blob/53483fa9340e4ec637985fe454ebb58afb92ea24/packages/actions/src/Exports/Models/Export.php#L55-L91","documentation":"Filament's Export model needs a `user()` relationship to attribute each export to the user who ran it. It first tries to resolve the `Illuminate\\Contracts\\Auth\\Authenticatable` interface from the container; when that is not bound it falls back to the conventional `App\\Models\\User` class. If neither exists, this LogicException is thrown as soon as the relationship is resolved (typically right after running an `ExportAction`). The message points you at the fix: register an explicit container binding instead of relying on convention.","triggerScenarios":"Running an export (or listing existing exports) in an application whose user model does not live at `App\\Models\\User` — e.g. `App\\Models\\Admin`, `App\\Domains\\Account\\User`, a multi-guard setup — while no `Authenticatable` binding is registered in any service provider's `register()`.","commonSituations":"Custom user namespaces, admin panels with a separate staff model, projects that moved models into domain folders, or bolting Filament onto an existing Laravel app that never had an `App\\Models\\User` class.","solutions":["Bind your user model to the contract in `app/Providers/AppServiceProvider.php`: `$this->app->bind(\\Illuminate\\Contracts\\Auth\\Authenticatable::class, config('auth.providers.users.model'));`","If the app really uses `App\\Models\\User`, verify the class exists at exactly that namespace and run `composer dump-autoload`.","Keep the binding config-driven so later changes to `config/auth.php` cannot desync it."],"exampleFix":"// before — export crashes resolving the `user()` relation\nExportAction::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 export actions (e.g. in a panel boot hook)\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 exports.'\n    );\n}","typeGuard":null,"tryCatchPattern":"try {\n    return $export->user;\n} catch (LogicException $exception) {\n    log()->warning('Export user relation unavailable: ' . $exception->getMessage());\n\n    return null;\n}","preventionTips":["Register the Authenticatable binding in a shared service provider, not ad hoc.","Drive the binding from config('auth.providers.users.model') so guard changes stay in sync.","Add a boot-time assert in a non-production environment that the binding resolves."],"tags":["filament","exports","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"}