© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•6mo ago•
15 replies
Mahmoud Elshiha

Filament Import Fails , Using `Admin` Model instead of `User`

--> Full Issue description in the text file in comments

Brief:
What I am trying to do:
- Import a CSV into a Filament resource via ImportAction (queued ImportCsv job), updating existing DailyGift rows by day.

What I did:
- Implemented a Filament Importer with columns (day, amount, coin_id).
- resolveRecord() returns the DailyGift by day or throws RowImportFailedException if missing.
- imports row is created with user_id = 1.
- Admin panel uses the admin guard. App\Models\Admin::find(1) returns a model; App\Models\User::find(1) is null.
- Queue driver: database; using queue:work.

My issue/the error:
- The ImportCsv job keeps failing and retrying with: Illuminate\Auth\SessionGuard::login(): Argument #1 ($user) must be of type Authenticatable, null given
- Stack shows Filament tries to log in the initiating user, but it resolves to null at runtime. This suggests the job authenticates via the default web/users provider instead of the admin/admins provider, so retrieveById(1) returns null. I can’t globally switch the default guard (other jobs rely on it).
Solution
After some research i have solved this problem using :
// AppServiceProvider
use Illuminate\Support\Facades\Route;

 public function boot(): void
    {
        Route::middlewareGroup('filament.actions', [
            'web',
            'auth:admin', 
        ]);
}
// AppServiceProvider
use Illuminate\Support\Facades\Route;

 public function boot(): void
    {
        Route::middlewareGroup('filament.actions', [
            'web',
            'auth:admin', 
        ]);
}


Also i was incorrectly importing Authenticatable at
use Illuminate\Contracts\Auth\Authenticatable;  // <- this is the Right Import

 public function register(): void
    {
      $this->app->bind(Authenticatable::class, Admin::class);
    }
use Illuminate\Contracts\Auth\Authenticatable;  // <- this is the Right Import

 public function register(): void
    {
      $this->app->bind(Authenticatable::class, Admin::class);
    }
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Admin Model instead of User model
FilamentFFilament / ❓┊help
9mo ago
Help: How do i use different Model (Admin) instead of using FilamentPHP default Model (User)
FilamentFFilament / ❓┊help
3y ago
Should I be using `Filament::user()` instead of `Auth::user()`?
FilamentFFilament / ❓┊help
10mo ago
FilamentPHP at '/' instead of '/admin' ?
FilamentFFilament / ❓┊help
3y ago