diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 2d91ddb..01c8f4a 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -25,8 +25,10 @@ class HomeController extends Controller { $items = \DB::table('items') ->join('item_user', 'item_user.item_id', '=', 'items.id') + ->join('products', 'products.id', '=', 'items.id') ->where('item_user.user_id', \Auth::id()) - ->select('items.*') + ->select('items.*', 'products.name as pname') + ->orderBy('items.name') ->get(); return view('home', compact('items')); } diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index 99b1262..b46f3ff 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -17,13 +17,24 @@