Merhaba, spagetti'den framework'e geçmeye çalışan yenilerden biriyim... Kodlama çalışmalarım sırasında ürün'e ait fiyat vb bilgileri çekerken slug değerini de çekmek istedim ShoppingCart paketi kullandığım için bi yerde gördüğüm örneği uyguladım ama bu sefer de
Missing required parameters for [Route: urun] [URI: urun/{slug_urunadi}]. (View: C:\projem\resources\views\sepet.blade.php)
gibi bir hata alıyorum... SepetController dosyamda ilgili satırlar :
public function ekle()
{
$urun = Urun::find(request('id'));
Cart::add($urun->id, $urun->urun_adi, 1, $urun->fiyati, ['slug'=>$urun->slug]);
return redirect()->route('sepet')
->with('mesaj', 'Ürün Sepete Eklendi!')
->with('mesaj_tur', 'success');
}
ilgili slug değerini çekmeye çalıştığım yerdeki kodlarım ise :
@foreach(Cart::content() as $urunCartItem)
<tr>
<td style="width:120px;"> <img src="http://via.placeholder.com/120x100?text=Ürün"></td>
<td>
<a href="{{ route('urun', $urunCartItem->options->slug) }}">
{{ $urunCartItem->name }}
</a></td>
<td>{{ $urunCartItem->price }}</td>
<td>
<a href="#" class="btn btn-xs btn-default">-</a>
<span style="padding: 10px 20px">{{ $urunCartItem->qty }}</span>
<a href="#" class="btn btn-xs btn-default">+</a>
</td>
<td class="text-right">
{{ $urunCartItem->subtotal }}
</td>
</tr>
@endforeach
nerede hata yaptığımı bilen gören varsa bana bi yardımcı olabilir mi? Sevgi ve saygılar