Update source into github
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Addon;
|
||||
|
||||
use App\Models\Addon;
|
||||
use App\Repositories\BaseRepository;
|
||||
|
||||
class AddonRepository extends BaseRepository implements AddonRepositoryInterface
|
||||
{
|
||||
public function getModel()
|
||||
{
|
||||
return Addon::class;
|
||||
}
|
||||
public function filter(array $data = [], array $relationships = [], array $withCount = [], array $select = ['*'])
|
||||
{
|
||||
$model = $this->model->with($relationships)->select($select);
|
||||
|
||||
if (count($withCount) > 0) {
|
||||
$model = $model->withCount($withCount);
|
||||
}
|
||||
if(isset($data['page'])) {
|
||||
return $model->paginate(15);
|
||||
}
|
||||
return $model->get();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user