© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
3 replies
dyo

error No query results for model in model when testing

I got above error when i tested editRecord..

Spesifically i got error

"No query results for model [App\Models\Setoran]"

here's my code:

$setoran = Setoran::where('lembagaId', $lembaga_id)->inRandomOrder()->first();

    $data = [
        'lembagaId' => $lembaga_id,
        'jenis_donasi_id' => $jenis_donasi_id,
        'rekening_id' => $rekening_id,
        'dana' => $dana,
    ];
    // dd($setoran->getRouteKey());

    $this->actingAs($user)->livewire(EditSetoran::class, ['record' => $setoran->getRouteKey()])
        ->fillForm($data)->call('save')->assertHasNoFormErrors();
$setoran = Setoran::where('lembagaId', $lembaga_id)->inRandomOrder()->first();

    $data = [
        'lembagaId' => $lembaga_id,
        'jenis_donasi_id' => $jenis_donasi_id,
        'rekening_id' => $rekening_id,
        'dana' => $dana,
    ];
    // dd($setoran->getRouteKey());

    $this->actingAs($user)->livewire(EditSetoran::class, ['record' => $setoran->getRouteKey()])
        ->fillForm($data)->call('save')->assertHasNoFormErrors();


What should i do?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Change query results
FilamentFFilament / ❓┊help
3y ago
Postgres searchable results in invalid query?
FilamentFFilament / ❓┊help
5mo ago
No morph map defined for model
FilamentFFilament / ❓┊help
3y ago
isIndividual column search removes table when no results
FilamentFFilament / ❓┊help
2y ago