Creating the very first routes and views - product and item

This commit is contained in:
Bruno F. Fontes 2018-09-08 12:38:01 -03:00
parent 7a69f68ad0
commit c706910d3a
Signed by: brunofontes
GPG Key ID: EE3447CE80048495
2 changed files with 12 additions and 1 deletions

View File

@ -80,6 +80,7 @@
<div class="title m-b-md">
Share It!
</div>
<div>Hello, {{$name}}!</div>
<div class="links">
<a href="https://laravel.com/docs">Documentation</a>

View File

@ -12,5 +12,15 @@
*/
Route::get('/', function () {
return view('welcome');
$name = 'Bruno';
return view('welcome', compact('name'));
});
Route::get('/product/{id}', function () {
$productID = DB::table('product')->find($id);
return view('product', compact['productID']);
});
Route::get('/item/{id}', function () {
return view('item');
});