public function buildRepository(Request $request): EloquentRepository
	{
		$input = [];

		/** @var \Illuminate\Routing\Route $route */
		$route = $request->route();

		// Resolve the model class if possible. And setup the repository.
		/** @var \Illuminate\Database\Eloquent\Model $model_class */
		$model_class = resolve(ModelResolver::class)->resolveModelClass($route);

		// Look for /{model-class}/{id} RESTful requests
		$parameters = $route->parametersWithoutNulls();
		if (! empty($parameters)) {
			$id    = reset($parameters);
			$input = compact('id');
		}

		// If the method is not GET lets get the input from everywhere.
		// @TODO hmm, need to verify what happens on DELETE and PATCH.
		if ($request->method() !== 'GET') {
			$input += $request->all();
		}

		// Resolve an eloquent repository bound to our standardized route parameter
		$repository = resolve(Repository::class);

		$repository->setModelClass($model_class)
			->setFilters((array) $request->get('filters'))
			->setSortOrder((array) $request->get('sort'))
			->setGroupBy((array) $request->get('group'))
			->setEagerLoads((array) $request->get('include'))
			->setAggregate((array) $request->get('aggregate'))
			->setDepthRestriction(config('magic-box.eager_load_depth'))
			->setInput($input);
		return $repository;
	}