Herkese merhaba arkadaşlar.
Laravelin dökünmanlarında modülün adını controller içinde direk olarak kullanıldığını gördüm.
hatta bir çok ders içeriğinde post, comments vb modellere direk adıyla ulaşılıyor.
Benim iki tane modelim var product ve image adında ama maalesef controller içinde kullandığımda şu hatayı veriyor.
Non-static method "ModelAdi::fonksiyon()" should not be called statically, assuming $this from incompatible context
internette bulduğum örnek kullanımlardan biri
public function show($id)
{
// get the product
$nerd = Product::find($id);
// show the view and pass the product to it
return View::make('product.show')
->with('product', $product);
}
Yukarıdaki örnekte "Product" model sınıfının adı
hatasız nasıl kullanabilirim.
Teşekkürler