Browse Source

代码生成器生成文件默认给777权限

jqh 5 years ago
parent
commit
fd68ae9711

+ 1 - 0
src/Scaffold/ControllerCreator.php

@@ -62,6 +62,7 @@ class ControllerCreator
         $model = $model ?: 'App\Admin\Repositories\\'.$slug;
 
         $this->files->put($path, $this->replace($stub, $this->name, $model, $slug));
+        $this->files->chmod($path, 0777);
 
         return $path;
     }

+ 4 - 1
src/Scaffold/LangCreator.php

@@ -45,7 +45,10 @@ class LangCreator
             $content['fields'][$field['name']] = $field['translation'] ?: $field['name'];
         }
 
-        if (app('files')->put($filename, Helper::exportArrayPhp($content))) {
+        $files = app('files');
+        if ($files->put($filename, Helper::exportArrayPhp($content))) {
+            $files->chmod($filename, 0777);
+
             return $filename;
         }
     }

+ 1 - 0
src/Scaffold/MigrationCreator.php

@@ -44,6 +44,7 @@ class MigrationCreator extends BaseMigrationCreator
         $stub = $this->files->get(__DIR__.'/stubs/create.stub');
 
         $this->files->put($path, $this->populateStub($name, $stub, $table));
+        $this->files->chmod($path, 0777);
 
         $this->firePostCreateHooks($table);
 

+ 1 - 0
src/Scaffold/ModelCreator.php

@@ -79,6 +79,7 @@ class ModelCreator
             ->replaceSpace($stub);
 
         $this->files->put($path, $stub);
+        $this->files->chmod($path, 0777);
 
         return $path;
     }

+ 2 - 0
src/Scaffold/RepositoryCreator.php

@@ -48,6 +48,8 @@ class RepositoryCreator
             $model,
         ], $content));
 
+        $files->chmod($path, 0777);
+
         return $path;
     }