In my new Laravel 5.8 app I read data from exteranal source using curl which has some filters. I need more filters applied and to save filtered rows in db. My question is how better filter data which were read with curl.
First idea to save all data in temp table with session_unique_id field as system is multiuser and apply filters on these data. The thing is that there more 10 filters in the system and using scopes I can controle filteres like:
public function scopeGetByVote($query, $vote_id= null)
{
if (!empty($vote_id)) {
if ( is_array($vote_id) ) {
$query->whereIn( with(new VoteItem)->getTable().'.vote_id', $vote_id );
} else {
$query->where( with(new VoteItem)->getTable() . '.vote_id', $vote_id );
}
}
return $query;
}
as some filteres can be selected, but some not.
Has Laravel 5.8 some better tools for rows filtering without writing data to temp tables? Are there some better tools from point of productivity? That is multiusers system and can have quite a lot of requests...
Thanks!
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire