Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nexxai's avatar
Level 37

Error: Interface "Filament\Models\Contracts\FilamentUser" not found

Ok I've been banging my head against the wall trying to figure this out but I'm at a loss.

This problem only happens in production, and I can't figure out why. The error appears in the failed_jobs exception column when an email is queued to be sent. The same functionality works perfectly fine on my local.

Error:

Error: Interface "Filament\Models\Contracts\FilamentUser" not found in [path_to_my_site]/app/Models/User.php:79
Stack trace:
#0 [path_to_my_site]/vendor/composer/ClassLoader.php(582): include()
#1 [path_to_my_site]/vendor/composer/ClassLoader.php(433): Composer\Autoload\{closure}()
#2 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php(793): Composer\Autoload\ClassLoader->loadClass()
#3 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php(225): Illuminate\Database\Eloquent\Model->newRelatedInstance()
#4 [path_to_my_site]/app/Models/TicketSeason.php(99): Illuminate\Database\Eloquent\Model->belongsTo()
#5 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php(574): App\Models\TicketSeason->administrator()
#6 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php(526): Illuminate\Database\Eloquent\Model->getRelationshipFromMethod()
#7 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php(451): Illuminate\Database\Eloquent\Model->getRelationValue()
#8 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(2227): Illuminate\Database\Eloquent\Model->getAttribute()
#9 [path_to_my_site]/storage/framework/views/1c6aca49e5904426357dd0026f2b22f8.php(12): Illuminate\Database\Eloquent\Model->__get()
#10 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(124): require('...')
#11 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(125): Illuminate\Filesystem\Filesystem::Illuminate\Filesystem\{closure}()
#12 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(58): Illuminate\Filesystem\Filesystem->getRequire()
#13 [path_to_my_site]/vendor/livewire/livewire/src/ComponentConcerns/RendersLivewireComponents.php(69): Illuminate\View\Engines\PhpEngine->evaluatePath()
#14 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(70): Livewire\LivewireViewCompilerEngine->evaluatePath()
#15 [path_to_my_site]/vendor/livewire/livewire/src/ComponentConcerns/RendersLivewireComponents.php(35): Illuminate\View\Engines\CompilerEngine->get()
#16 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/View/View.php(195): Livewire\LivewireViewCompilerEngine->get()
#17 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/View/View.php(178): Illuminate\View\View->getContents()
#18 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/View/View.php(147): Illuminate\View\View->renderContents()
#19 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Mail/Markdown.php(65): Illuminate\View\View->render()
#20 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(340): Illuminate\Mail\Markdown->render()
#21 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(305): Illuminate\Mail\Mailable->buildMarkdownView()
#22 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(205): Illuminate\Mail\Mailable->buildView()
#23 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Support/Traits/Localizable.php(19): Illuminate\Mail\Mailable->Illuminate\Mail\{closure}()
#24 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(198): Illuminate\Mail\Mailable->withLocale()
#25 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Mail/SendQueuedMailable.php(74): Illuminate\Mail\Mailable->send()
#26 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Mail\SendQueuedMailable->handle()
#27 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#28 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#29 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod()
#30 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call()
#31 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): Illuminate\Container\Container->call()
#32 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}()
#33 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#34 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): Illuminate\Pipeline\Pipeline->then()
#35 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(123): Illuminate\Bus\Dispatcher->dispatchNow()
#36 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Queue\CallQueuedHandler->Illuminate\Queue\{closure}()
#37 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#38 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(122): Illuminate\Pipeline\Pipeline->then()
#39 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(70): Illuminate\Queue\CallQueuedHandler->dispatchThroughMiddleware()
#40 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(98): Illuminate\Queue\CallQueuedHandler->call()
#41 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(434): Illuminate\Queue\Jobs\Job->fire()
#42 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(384): Illuminate\Queue\Worker->process()
#43 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(175): Illuminate\Queue\Worker->runJob()
#44 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(136): Illuminate\Queue\Worker->daemon()
#45 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(119): Illuminate\Queue\Console\WorkCommand->runWorker()
#46 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Queue\Console\WorkCommand->handle()
#47 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#48 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#49 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod()
#50 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call()
#51 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Console/Command.php(194): Illuminate\Container\Container->call()
#52 [path_to_my_site]/vendor/symfony/console/Command/Command.php(312): Illuminate\Console\Command->execute()
#53 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Console/Command.php(163): Symfony\Component\Console\Command\Command->run()
#54 [path_to_my_site]/vendor/symfony/console/Application.php(1040): Illuminate\Console\Command->run()
#55 [path_to_my_site]/vendor/symfony/console/Application.php(314): Symfony\Component\Console\Application->doRunCommand()
#56 [path_to_my_site]/vendor/symfony/console/Application.php(168): Symfony\Component\Console\Application->doRun()
#57 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(200): Symfony\Component\Console\Application->run()
#58 [path_to_my_site]/artisan(35): Illuminate\Foundation\Console\Kernel->handle()
#59 {main}

Next Illuminate\View\ViewException: Interface "Filament\Models\Contracts\FilamentUser" not found (View: [path_to_my_site]/resources/views/emails/season/invite.blade.php) in [path_to_my_site]/app/Models/User.php:79
Stack trace:
#0 [path_to_my_site]/vendor/livewire/livewire/src/ComponentConcerns/RendersLivewireComponents.php(106): Illuminate\View\Engines\CompilerEngine->handleViewException()
#1 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(60): Livewire\LivewireViewCompilerEngine->handleViewException()
#2 [path_to_my_site]/vendor/livewire/livewire/src/ComponentConcerns/RendersLivewireComponents.php(69): Illuminate\View\Engines\PhpEngine->evaluatePath()
#3 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(70): Livewire\LivewireViewCompilerEngine->evaluatePath()
#4 [path_to_my_site]/vendor/livewire/livewire/src/ComponentConcerns/RendersLivewireComponents.php(35): Illuminate\View\Engines\CompilerEngine->get()
#5 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/View/View.php(195): Livewire\LivewireViewCompilerEngine->get()
#6 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/View/View.php(178): Illuminate\View\View->getContents()
#7 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/View/View.php(147): Illuminate\View\View->renderContents()
#8 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Mail/Markdown.php(65): Illuminate\View\View->render()
#9 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(340): Illuminate\Mail\Markdown->render()
#10 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(305): Illuminate\Mail\Mailable->buildMarkdownView()
#11 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(205): Illuminate\Mail\Mailable->buildView()
#12 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Support/Traits/Localizable.php(19): Illuminate\Mail\Mailable->Illuminate\Mail\{closure}()
#13 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Mail/Mailable.php(198): Illuminate\Mail\Mailable->withLocale()
#14 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Mail/SendQueuedMailable.php(74): Illuminate\Mail\Mailable->send()
#15 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Mail\SendQueuedMailable->handle()
#16 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#17 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#18 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod()
#19 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call()
#20 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): Illuminate\Container\Container->call()
#21 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}()
#22 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#23 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): Illuminate\Pipeline\Pipeline->then()
#24 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(123): Illuminate\Bus\Dispatcher->dispatchNow()
#25 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Queue\CallQueuedHandler->Illuminate\Queue\{closure}()
#26 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#27 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(122): Illuminate\Pipeline\Pipeline->then()
#28 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(70): Illuminate\Queue\CallQueuedHandler->dispatchThroughMiddleware()
#29 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(98): Illuminate\Queue\CallQueuedHandler->call()
#30 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(434): Illuminate\Queue\Jobs\Job->fire()
#31 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(384): Illuminate\Queue\Worker->process()
#32 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(175): Illuminate\Queue\Worker->runJob()
#33 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(136): Illuminate\Queue\Worker->daemon()
#34 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(119): Illuminate\Queue\Console\WorkCommand->runWorker()
#35 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Queue\Console\WorkCommand->handle()
#36 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#37 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#38 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod()
#39 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call()
#40 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Console/Command.php(194): Illuminate\Container\Container->call()
#41 [path_to_my_site]/vendor/symfony/console/Command/Command.php(312): Illuminate\Console\Command->execute()
#42 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Console/Command.php(163): Symfony\Component\Console\Command\Command->run()
#43 [path_to_my_site]/vendor/symfony/console/Application.php(1040): Illuminate\Console\Command->run()
#44 [path_to_my_site]/vendor/symfony/console/Application.php(314): Symfony\Component\Console\Application->doRunCommand()
#45 [path_to_my_site]/vendor/symfony/console/Application.php(168): Symfony\Component\Console\Application->doRun()
#46 [path_to_my_site]/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(200): Symfony\Component\Console\Application->run()
#47 [path_to_my_site]/artisan(35): Illuminate\Foundation\Console\Kernel->handle()
#48 {main}

User.php:

<?php

namespace App\Models;

use Filament\Models\Contracts\FilamentUser;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Cashier\Billable;
use Laravel\Fortify\TwoFactorAuthenticatable;
use Laravel\Jetstream\HasProfilePhoto;
use Laravel\Jetstream\HasTeams;
use Laravel\Sanctum\HasApiTokens;

class User extends Authenticatable implements FilamentUser
{
    use HasApiTokens;
    use HasFactory;
    use HasProfilePhoto;
    use HasTeams;
    use Notifiable;
    use TwoFactorAuthenticatable;
    use Billable;

    [snip]

    public function canAccessFilament(): bool
    {
        return $this->email == '[email protected]';
    }
}

invite.blade.php (including the only references to any kind of user, in case it's relevant):

<x-mail::message>
# Invitation

{{ $invite->administrator->name }} just invited you to ...

[button here]

Thanks,<br>
{{ config('app.name') }}

</x-mail::message>

Can anyone see any reason why this would error out?

0 likes
6 replies
kokoshneta's avatar

Clearly the class is missing for some reason. Have you checked that the file is located in the correct folder on your production server?

Odd Filament caching errors, which this looks like it could potentially be, can sometimes be fixed by running artisan filament:upgrade (on the production server, that is) – have you tried that?

nexxai's avatar
Level 37

@kokoshneta

Tried the following, but still no luck.

user@box:~/mysite.com$ php artisan filament:upgrade

   INFO  Configuration cache cleared successfully.

Livewire auto-discovery manifest rebuilt!
   INFO  Route cache cleared successfully.

   INFO  Compiled views cleared successfully.

Successfully upgraded!
user@box:~/mysite.com$ ls vendor/filament/filament/src/Models/Contracts/
FilamentUser.php  HasAvatar.php  HasName.php
user@box:~/mysite.com$
kokoshneta's avatar

@nexxai Hmm… and I don’t suppose a composer install or composer dump-autoload on the production server helps either?

nexxai's avatar
Level 37

@kokoshneta I had tried both of those already earlier and no dice.

It makes no sense.

kokoshneta's avatar

@nexxai Does it also happen if you send the e-mail immediately as part of the user-initiated request, or is it only if you queue it?

If it’s the latter, it could just be that your queue worker hasn’t been restarted since the Composer or Filament update that actually fixed the issue (queue workers work on ‘snapshots’ of your code and won’t catch changes until restarted).

nexxai's avatar
nexxai
OP
Best Answer
Level 37

@kokoshneta Ok I have no idea what the root cause was but I rebuilt the queue worker and recreated the supervisord conf, and now it works perfectly. I have no idea what the problem could have been but I'm satisfied.

Please or to participate in this conversation.