Saturday, April 15, 2017

get values from two different table in display in view - laravel

I have tow tables in my database with both are some totally different but it store some common information and i need to display it on view

table 1 = stock

  • id
  • purchase_date
  • seller_name
  • item_name
  • price

table 2 = purchase_sold

  • id
  • purhase_date
  • seller_name
  • item_name
  • price
  • customer_name
  • sold_date
  • sold_price

Now i need all data from both of table in order of purchase_date in my view, so how can i get this both of this. I make both table different because some seller sold some items directly to customers - in table purchase_sold, And other in stock because selling from stock is store some different information that's why i make it different.



via HirenMangukiya

Advertisement