lundi 30 juillet 2018

Laravel 5. how to achieve this?

$stocks = StocksUnderMedication::where('user_id', Auth::user()->id)->get();

The above code gets all the rows that are in "StocksUnderMedication" table.

$originals = Stock::where('user_id', Auth::user()->id)->get();

The above code gets all the rows that are in "Stock" table.

I'm trying to get all the rows in the Stock table whose "tag_no" equals "tag" in StockUnderMedication table.

That is Stock table has tag_no field and StockUnderMedication has tag field.

How can i achieve this?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2OrBDcZ
via IFTTT

Aucun commentaire:

Enregistrer un commentaire