Skip to content

Commit 02fd69b

Browse files
author
Marcel Gwerder
committed
Fixed issue with facade binding - closes #32
1 parent eeac90d commit 02fd69b

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/ApiHandlerServiceProvider.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ public function boot()
3030
*/
3131
public function register()
3232
{
33-
$this->app['ApiHandler'] = $this->app->singleton('Marcelgwerder\ApiHandler', function ($app) {
34-
return new ApiHandler;
35-
});
33+
$this->app->bind('ApiHandler', 'Marcelgwerder\ApiHandler\ApiHandler');
3634
}
3735
}

src/CountMetaProvider.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php namespace Marcelgwerder\ApiHandler;
22

3-
use Illuminate\Support\Facades\DB;
4-
53
class CountMetaProvider extends MetaProvider
64
{
75
/**
@@ -37,7 +35,7 @@ public function get()
3735
$this->builder->limit = null;
3836

3937
//Use the original builder as a subquery and count over it because counts over groups return the number of rows for each group, not for the total results
40-
$query = DB::query()->selectRaw('count(*) as aggregate from (' . $this->builder->toSql() . ') as count_table', $this->builder->getBindings());
38+
$query = $this->builder->newQuery()->selectRaw('count(*) as aggregate from (' . $this->builder->toSql() . ') as count_table', $this->builder->getBindings());
4139
return intval($query->first()->aggregate);
4240
}
4341

0 commit comments

Comments
 (0)