ok i want to create route like showing data in another page like this
http://localhost:8000/uraian/1
my route like this
Route::get('/uraian/{id}', [PengadaanController::class, 'uraian'])->name('uraian');
i can access this and its normal . now its my livewire function
<?php
namespace App\Http\Livewire;
use Livewire\WithPagination;
use App\Models\Kegi;
use App\Models\Uraian;
use Livewire\Component;
class UraianLw extends Component
{
use WithPagination;
public $uraianid ,$kegiatan_id ,$kode_rekening ,$uraian ,$anggaran ;
public function render($id)
{
$kegiatan = Kegi::findOrFail($id);// here the problem
$newid = $kegiatan->id ;
return view('livewire.uraian-lw',[
'uraian' => Uraian::where('id' ,$newid)->where('uraian', 'like', '%'.$this->search.'%')->paginate(10)
]);
}
}
and have error
Unable to resolve dependency [Parameter #0 [ $id ]] in class App\Http\Livewire\Uraian
how can solved this problem ?
#update its my blade
<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
{{ __('Dashboard') }}
</h2>
</x-slot>
@livewire('uraian-lw')
</x-app-layout>
you should use this
App\Http\Livewire\UraianLw.php