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

UmaWorld's avatar

Unable to resolve dependency [Parameter #0 [ <required> $proposalId ]] in class App\Http\Livewire\ShowProposals

Unable to resolve dependency [Parameter #0 [ $proposalId ]] in class App\Http\Livewire\ShowProposals

I got this error

0 likes
4 replies
UmaWorld's avatar

Unable to resolve dependency [Parameter #0 [ $proposalId ]] in class App\Http\Livewire\ShowProposals

i got this error from this component

namespace App\Http\Livewire;

use App\Models\Proposal; use Exception; use Livewire\Component; use Livewire\WithPagination;

class ShowProposals extends Component { use WithPagination;

public function mount()

{ $this->listeners = ['deleteProposal']; }

 public function deleteProposal($proposalId)
{
    $proposal = Proposal::find($proposalId);
    if ($proposal) {
        $proposal->delete();
        session()->flash('message', 'Proposal deleted successfully.');
        return redirect()->route('dashboard'); // Adjust the route as needed
    }
}
public function render()
{
    return view('livewire.show-proposals',[
        'proposals' => Proposal::orderBy('updated_at', 'desc')->paginate(10),
    ]);
}

}

Snapey's avatar

format your code blocks in your question so that we can see the code correctly

also show the html that loads the component

UmaWorld's avatar

i could not able to share the code is there any format to post

Snapey's avatar

@UmaWorld there is a link at the bottom each reply that explains how to post.

basically three backticks ``` on their own line before and after each block of code

Please or to participate in this conversation.