mercredi 1 février 2017

Laravel: How to get an array of existing ids from a column, where later on will use `whereIn`

consider the following function:

public function index($countryCode, Request $request) {
                $invalidCountryTranslations = $countriesTranslation->whereIn('LanguageID', $arrayOfExistingIds)->get();
return view('admin.countriesTranslations.create', compact('countryCode', 'languages', 'countriesTranslation'));
}

I am using the above function to find out which countries are already in the table (so it wouldn't be called into the view) so basically $arrayOfExistingIds should hold those existing rows from LanguageID column.

so the question is, how do I get the existing arrays of a LanguageID column?

$arrayOfExistingIds = ???



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

Aucun commentaire:

Enregistrer un commentaire