public function getEntitiesByTypeAndLang($lang, $type)
    {
        $entities = collect();
        $collection = $this->model->where('entity_type', $type)->where('entity_data', 'LIKE', '%"lang":"'.$lang.'"%')->get();

        foreach ($collection as $item) {
            $instance = app($item->type)->attributes = $item->data;
            $entities->push($instance);
        }

        return $entities;
    }
public function getEntitiesByTypeAndLang($lang, $type)
    {
        $entities = collect();
        $collection = $this->model->where('entity_type', $type)->where('entity_data', 'LIKE', '%"lang":"'.$lang.'"%')->get();

        foreach ($collection as $item) {
            $instance = app($item->type)->attributes = $item->data;
            $entities->push($instance);
        }

        return $entities;
    }
public function getEntitiesByTypeAndLang ( $ lang , $ type ) { $ entities = collect ( ) ; $ collection = $ this -> model -> where ( 'entity_type' , $ type ) -> where ( 'entity_data' , 'LIKE' , '%"lang":"' . $ lang . '"%' ) -> get ( ) ; foreach ( $ collection as $ item ) { $ instance = app ( $ item -> type ) -> attributes = $ item -> data ; $ entities -> push ( $ instance ) ; } return $ entities ; }
Get entities by type and language

@param  string $lang
@param  string $type

@return Illuminate\Support\Collection
Get entities by type and language