FilamentF
Filament3y ago
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();


What should i do?
Was this page helpful?