1 year ago

a simple MVC example

Posted 1 year ago by hockeymonkey96

I'm new to Laravel and trying to build a very simple MVC example (the documentation examples go from route to view but I want to involve a Controller) to return a image file for a product.

So I have for my route:

Route::get('/products', '[email protected]');

Then my ProductController action:

public function index() { return view('/pages/product', compact('product')); }

And my product.blade.php (nested in views/pages/product):

<h1><img src="/images/product/Frozen_Ophelia_800x.png"></h1>

I keep getting a ReflectionException Class App\Product does not exist.

Please sign in or create an account to participate in this conversation.