protected function createRepository(
        ReflectionClass $model,
        $fileName,
        $shortName,
        $namespace,
        $contractName,
        $contractNamespace,
        array $methods
    ) {
        $path = app_path($fileName);

        $stub = $this->compileStub('repository.stub', [
            'namespace'          => $namespace,
            'class'              => $shortName,
            'model.fullname'     => $model->getName(),
            'model'              => $model->getShortName(),
            'implementation'     => $this->getImplementationClass($contractName),
            'implementation.use' => $this->getImplementationUse($contractNamespace, $contractName),
        ]);

        $stub = $this->compileMethods($stub, $methods);

        $this->files->makeDirectory(dirname($path), 0755, true, true);

        $this->files->put($path, $stub);

        return $namespace . '\\' . $shortName;
    }