You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In laravel 8 and php 7.3 when I call save function as written in the docs I get this error Call to undefined function Basemkhirat\Elasticsearch\array_except() in file /home/elasticsearch/elasticsearch-practice/vendor/basemkhirat/elasticsearch/src/Model.php on line 349
The text was updated successfully, but these errors were encountered:
I ran across this same issue when implementing this inside Lumen. I didn't wish to butcher the package itself so implemented the array_except function in a local helper.
Not suggesting my logic is the best solution
if (!function_exists('array_except')) {
/**
* Provide array_except helper. This is normally available in Laravel, however, not in Lumen.
* Basemkhirat\Elasticsearch requires this
*
* @param array $array
* @param array $exclude
* @return array
*/
function array_except(array $array, array $exclude)
{
return collect($array)->except($exclude)->toArray();
}
}
Afterwards, I added this helper to my psr files list and rebuilt the autoload.. composer.json
In laravel 8 and php 7.3 when I call save function as written in the docs I get this error
Call to undefined function Basemkhirat\Elasticsearch\array_except() in file /home/elasticsearch/elasticsearch-practice/vendor/basemkhirat/elasticsearch/src/Model.php on line 349
The text was updated successfully, but these errors were encountered: