filamentphp/filament · error · LogicException
No [{$userClass}] model found. Please bind an authenticatabl
Error message
No [{$userClass}] model found. Please bind an authenticatable model to the [Illuminate\Contracts\Auth\Authenticatable] interface in a service provider's [register()] method. What it means
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.
Source
Thrown at packages/actions/src/Exports/Models/Export.php:73
public function user(): BelongsTo
{
if (static::hasPolymorphicUserRelationship()) {
return $this->morphTo();
}
/** @var ?Authenticatable $authenticatable */
$authenticatable = app(Authenticatable::class);
if ($authenticatable) {
/** @phpstan-ignore-next-line */
return $this->belongsTo($authenticatable::class);
}
$userClass = app()->getNamespace() . 'Models\\User';
if (! class_exists($userClass)) {
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.');
}
/** @phpstan-ignore-next-line */
return $this->belongsTo($userClass);
}
/**
* @param array<string, string> $columnMap
* @param array<string, mixed> $options
*/
public function getExporter(
array $columnMap,
array $options,
): Exporter {
$this->columnMap($columnMap);
$this->options($options);
return app($this->exporter, [View on GitHub (pinned to 53483fa934)
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.
Example fix
// before — export crashes resolving the `user()` relation
ExportAction::make();
// after — app/Providers/AppServiceProvider.php
use Illuminate\Contracts\Auth\Authenticatable;
public function register(): void
{
$this->app->bind(Authenticatable::class, config('auth.providers.users.model'));
} Defensive patterns
Strategy: validation
Validate before calling
// Run before enabling export actions (e.g. in a panel boot hook)
use Illuminate\Contracts\Auth\Authenticatable;
$userModelResolved = app()->bound(Authenticatable::class)
|| class_exists(app()->getNamespace() . 'Models\\User');
if (! $userModelResolved) {
throw new RuntimeException(
'Bind Authenticatable to your user model before using exports.'
);
} Try / catch
try {
return $export->user;
} catch (LogicException $exception) {
log()->warning('Export user relation unavailable: ' . $exception->getMessage());
return null;
} Prevention
- 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.
When it happens
Trigger: 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()`.
Common situations: 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.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
Related errors
- No [{$userClass}] model found. Please bind an authenticatabl
- The relationship [{$name}] does not exist on the model [{$th
- The relationship [{$relationshipName}] does not exist on the
- The relationship [{$relationshipName}] does not exist on the
- Import column of class [$importColumnClass] must have a uniq
AI-assisted analysis of filamentphp/filament@53483fa934 (2026-08-17).
Data as JSON: /api/errors/897b50e7fee57895.
Report an issue: GitHub.