Commit 42777c65 authored by hj's avatar hj

更新

parent 38eaed8c
...@@ -29,12 +29,15 @@ class RepositoryServiceProvider extends LumenRepositoryServiceProvider ...@@ -29,12 +29,15 @@ class RepositoryServiceProvider extends LumenRepositoryServiceProvider
protected function bindRepository($path) protected function bindRepository($path)
{ {
$files = app(Filesystem::class)->files(base_path($path)); $files = app(Filesystem::class)->allFiles(base_path($path));
if($files){ if($files){
collect($files)->map(function ($file) use ($path){ collect($files)->map(function ($file) use ($path){
$filePath = $file->getRelativePathname(); $filePath = $file->getRelativePathname();
$class = str_replace('/', '\\', $path).'\\';
$class = ucfirst($path).'\\'; if(!Str::contains($filePath, 'app')){
$class = 'app\\'.$class;
}
$class = ucfirst($class);
$concrete = str_replace('Contracts', 'Eloquent', $class); $concrete = str_replace('Contracts', 'Eloquent', $class);
if(Str::contains($filePath,'/')){ if(Str::contains($filePath,'/')){
list($directory, $file) = explode('/',$filePath); list($directory, $file) = explode('/',$filePath);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment