Merge remote-tracking branch 'upstream/master' into web-vital-v1

This commit is contained in:
devansh bawari 2020-12-30 15:47:59 +05:30
commit c8d44007a3
3 changed files with 16 additions and 23 deletions

View File

@ -235,14 +235,12 @@ class ProductRepository extends Repository
if ($attribute->type != 'price') {
$attributeQuery->where(function ($attributeValueQuery) use ($column, $filterInputValues) {
// foreach ($filterInputValues as $filterValue) {
// if (! is_numeric($filterValue)) {
// continue;
// }
// $attributeValueQuery->orWhereRaw("find_in_set(?, {$column})", [$filterValue]);
// }
$attributeValueQuery->whereIn($column, $filterInputValues);
foreach ($filterInputValues as $filterValue) {
if (! is_numeric($filterValue)) {
continue;
}
$attributeValueQuery->orWhereRaw("find_in_set(?, {$column})", [$filterValue]);
}
});
} else {

View File

@ -67,12 +67,12 @@ class VelocityServiceProvider extends ServiceProvider
protected function registerFacades()
{
$loader = AliasLoader::getInstance();
$loader->alias('velocity', VelocityFacade::class);
}
/**
* this function will provide global variables shared by view (blade files)
* This method will load all publishables.
*
* @return boolean
*/
@ -85,24 +85,26 @@ class VelocityServiceProvider extends ServiceProvider
$this->publishes([
__DIR__ . '/../Resources/views/shop' => resource_path('themes/velocity/views'),
]);
$this->publishes([__DIR__.'/../Resources/lang' => resource_path('lang/vendor/velocity')]);
return true;
}
/**
* this function will provide global variables shared by view (blade files)
* This method will provide global variables shared by view (blade files).
*
* @return boolean
*/
private function loadGloableVariables()
{
$velocityHelper = app('Webkul\Velocity\Helpers\Helper');
$velocityMetaData = $velocityHelper->getVelocityMetaData();
view()->composer('*', function ($view) {
$velocityHelper = app('Webkul\Velocity\Helpers\Helper');
$velocityMetaData = $velocityHelper->getVelocityMetaData();
view()->share('showRecentlyViewed', true);
view()->share('velocityMetaData', $velocityMetaData);
$view->with('showRecentlyViewed', true);
$view->with('velocityMetaData', $velocityMetaData);
});
return true;
}

View File

@ -1,10 +1,3 @@
@php
$velocityHelper = app('Webkul\Velocity\Helpers\Helper');
$velocityMetaData = $velocityHelper->getVelocityMetaData();
view()->share('velocityMetaData', $velocityMetaData);
@endphp
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">