Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use arrays for directories #1

Open
4n70w4 opened this issue Nov 24, 2020 · 1 comment
Open

Use arrays for directories #1

4n70w4 opened this issue Nov 24, 2020 · 1 comment

Comments

@4n70w4
Copy link

4n70w4 commented Nov 24, 2020

Hi! I use https://github.com/nWidart/laravel-modules for separate my applications by modules.
And I have more directories contains Model classes: Modules/*/Entities/*
Also, repositories need to be generated in the module directory.

https://github.com/lab2view/laravel-repository-generator/blob/master/config/repository-generator.php

The current configuration does not allow specifying an array of directories.

@4n70w4 4n70w4 changed the title Use custom model directories Use arrays for directories Nov 24, 2020
@4n70w4
Copy link
Author

4n70w4 commented Nov 24, 2020

For example config:

    'repository_directory' => app_path('Repositories/'),
    // or 'repository_directory' => base_path('Modules/*/Repositories/'),
    'model_directory' => base_path('Modules/*/Entities/'),

But error:

php artisan make:repositories

 Do you want to overwrite the existing files? (Yes/No): (yes/no) [no]:
 > yes


   ErrorException

  file_put_contents(/var/www/app/app/Repositories//var/www/app/Modules/Scoring/Entities/FeatureRepository.php): failed to open stream: No such file or directory

  at vendor/lab2view/laravel-repository-generator/src/Console/Commands/Generate.php:189
    185|      * @param $content
    186|      */
    187|     private function writeFile($file, $content)
    188|     {
  > 189|         file_put_contents($file, $content);
    190|     }
    191|
    192|     /**
    193|      * Check repository folder permissions.

      +16 vendor frames
  17  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

And

   Error

  Class 'Lab2View\RepositoryGenerator\Exceptions\FileException' not found

  at vendor/lab2view/laravel-repository-generator/src/Console/Commands/Generate.php:207
    203|         $repositoryParentPath = $this->parentPath('repository');
    204|
    205|         // Check parent of repository directory is writable.
    206|         if (!file_exists($repositoryPath) && !is_writable($repositoryParentPath)) {
  > 207|             throw FileException::notWritableDirectory($repositoryParentPath);
    208|         }
    209|
    210|         // Check repository directory permissions.
    211|         if (file_exists($repositoryPath) && !is_writable($repositoryPath)) {

      +15 vendor frames
  16  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant