app/Http/Controllers/Buyer/BuyerProductController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index(Buyer $buyer)
    {
        $products = $buyer -> transactions()-> with('product')->get()->pluck('product');
        return $this -> showAll($products);
    }
public function index ( Buyer $ buyer ) { $ products = $ buyer -> transactions ( ) -> with ( 'product' ) -> get ( ) -> pluck ( 'product' ) ; return $ this -> showAll ( $ products ) ; }
Display a listing of the resource.
Display a listing of the resource .