Unable to resolve dependency [Parameter #0 [ <required> $id ]] in class

I get the following error and i dont know what do, HELP!

FacturaComponent renders the table blade right? How you are handle the create and edit methods…modals, forms? The issue is related with parameter, like you’re trying to bind some data to another component

That right!!

I put like this:

@include("livewire.factura.$view")

And form

so…it’s working now? did you manage the issue?

I have the same issue :frowning:

and what about the __construct??? if you have the mount method why do you declare that?

and where is the edit blade?

I assume that you have something like this:
factura-component.blade.php

<div>
      
    <div>
        @livewire('livewire.factura.$view')
    <div/>

    <div>
        @livewire('livewire.factura.table')
    <div/>

<div/>

So you need two blades for ‘create’ and ‘edit’

Hey, @LfJohnVo

Make sure you passed $id is not null and try to do this instead

<button wire:click="$set('edit', {{ $factura->id }})">Edit</button>
1 Like

Hey!!!, it doesnt works!!!
im still have the same error

Make sure you are passing the $id and is not null or something …

I think that the matter is in FacturaComponent and the $id that is expecting to be load in mont() and _construct. If FacturaComponent list all the facturas, why the __construct($id)??? And the mount($contrato_id) you are binding as well this parameter?

I finally get the solution, my query was wrong

This info solved my problem. Thanks. again