mirror of
https://github.com/brunofontes/shareit.git
synced 2025-11-15 07:50:54 -03:00
Adding product name with the item name on the Home page
This commit is contained in:
@@ -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'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user