FleetCart/Modules/Support/Providers/EloquentMacroServiceProvider.php

24 lines
497 B
PHP
Raw Permalink Normal View History

2023-06-11 12:14:03 +00:00
<?php
namespace Modules\Support\Providers;
use Illuminate\Database\Query\Builder;
use Illuminate\Support\ServiceProvider;
class EloquentMacroServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Builder::macro('resetOrders', function () {
$this->{$this->unions ? 'unionOrders' : 'orders'} = null;
return $this;
});
}
}