Open 4n70w4 opened 3 years ago
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))
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.