@@ -5,19 +5,19 @@ |
||
5 | 5 | |
6 | 6 | class FileSystem extends SymphonyFilesystem |
7 | 7 | { |
8 | - public function clone($src, $dest){ |
|
9 | - $src = $this->getFullSourcePath($src); |
|
8 | + public function clone($src, $dest){ |
|
9 | + $src = $this->getFullSourcePath($src); |
|
10 | 10 | |
11 | - $dest = base_path($dest); |
|
11 | + $dest = base_path($dest); |
|
12 | 12 | |
13 | - if (is_dir($src)) { |
|
14 | - $this->mirror($src, $dest."/".basename($src)); |
|
15 | - }else{ |
|
16 | - $this->copy($src, $dest); |
|
17 | - } |
|
18 | - } |
|
13 | + if (is_dir($src)) { |
|
14 | + $this->mirror($src, $dest."/".basename($src)); |
|
15 | + }else{ |
|
16 | + $this->copy($src, $dest); |
|
17 | + } |
|
18 | + } |
|
19 | 19 | |
20 | - public function getFullSourcePath($path){ |
|
21 | - return realpath(__DIR__ . "/../resources/" . $path); |
|
22 | - } |
|
20 | + public function getFullSourcePath($path){ |
|
21 | + return realpath(__DIR__ . "/../resources/" . $path); |
|
22 | + } |
|
23 | 23 | } |
@@ -17,10 +17,10 @@ |
||
17 | 17 | $fullFilePath = $this->getPath("app/Http/Requests/Backend/").$this->module->getModelName()."Request".".php"; |
18 | 18 | file_put_contents($fullFilePath, $controllerTemplate); |
19 | 19 | return $fullFilePath; |
20 | - } |
|
20 | + } |
|
21 | 21 | |
22 | - protected function getRules(){ |
|
23 | - // Todo |
|
24 | - return ""; |
|
25 | - } |
|
22 | + protected function getRules(){ |
|
23 | + // Todo |
|
24 | + return ""; |
|
25 | + } |
|
26 | 26 | } |
@@ -38,8 +38,8 @@ discard block |
||
38 | 38 | $this->insertIntoFile( |
39 | 39 | $webRouteFile, |
40 | 40 | "<?php\n", |
41 | - "use App\\Http\\Controllers\\".$this->module->getModelName()."Controller;\n" |
|
42 | - ); |
|
41 | + "use App\\Http\\Controllers\\".$this->module->getModelName()."Controller;\n" |
|
42 | + ); |
|
43 | 43 | |
44 | 44 | $this->insertIntoFile( |
45 | 45 | $webRouteFile, |
@@ -47,13 +47,13 @@ discard block |
||
47 | 47 | "\n".$this->getTabs(1)."Route::resource('".$this->module->getModuleName()."', ".$this->module->getModelName()."Controller::class);" |
48 | 48 | ); |
49 | 49 | |
50 | - $generatedFiles[] = $webRouteFile; |
|
50 | + $generatedFiles[] = $webRouteFile; |
|
51 | 51 | |
52 | 52 | $this->insertIntoFile( |
53 | 53 | $backendWebRouteFile, |
54 | 54 | "<?php\n", |
55 | - "use App\\Http\\Controllers\\Backend\\".$this->module->getModelName()."Controller;\n" |
|
56 | - ); |
|
55 | + "use App\\Http\\Controllers\\Backend\\".$this->module->getModelName()."Controller;\n" |
|
56 | + ); |
|
57 | 57 | |
58 | 58 | $this->insertIntoFile( |
59 | 59 | $backendWebRouteFile, |
@@ -1,22 +1,22 @@ |
||
1 | 1 | <?php |
2 | 2 | return [ |
3 | - 'items_to_generate' => [ |
|
4 | - 'Common' => [ |
|
5 | - 'Migration', |
|
6 | - 'Model', |
|
7 | - 'Seeder', |
|
8 | - 'Route' |
|
9 | - ], |
|
10 | - 'Frontend' => [ |
|
11 | - 'Controller', |
|
12 | - 'View' |
|
13 | - ], |
|
14 | - 'Backend' => [ |
|
15 | - 'Controller', |
|
16 | - 'Request', |
|
17 | - 'View' |
|
18 | - ] |
|
19 | - ], |
|
20 | - 'skip_generators' => [], |
|
21 | - 'override' => true |
|
3 | + 'items_to_generate' => [ |
|
4 | + 'Common' => [ |
|
5 | + 'Migration', |
|
6 | + 'Model', |
|
7 | + 'Seeder', |
|
8 | + 'Route' |
|
9 | + ], |
|
10 | + 'Frontend' => [ |
|
11 | + 'Controller', |
|
12 | + 'View' |
|
13 | + ], |
|
14 | + 'Backend' => [ |
|
15 | + 'Controller', |
|
16 | + 'Request', |
|
17 | + 'View' |
|
18 | + ] |
|
19 | + ], |
|
20 | + 'skip_generators' => [], |
|
21 | + 'override' => true |
|
22 | 22 | ]; |
23 | 23 | \ No newline at end of file |
@@ -30,8 +30,8 @@ |
||
30 | 30 | public function register() |
31 | 31 | { |
32 | 32 | // Register Intervention Provider and Facade |
33 | - $this->app->register(ImageServiceProvider::class); |
|
34 | - AliasLoader::getInstance()->alias('Image', Image::class); |
|
33 | + $this->app->register(ImageServiceProvider::class); |
|
34 | + AliasLoader::getInstance()->alias('Image', Image::class); |
|
35 | 35 | |
36 | 36 | $this->app->bind('command.laragen:make', Generate::class); |
37 | 37 |
@@ -11,13 +11,13 @@ discard block |
||
11 | 11 | public function generate() |
12 | 12 | { |
13 | 13 | |
14 | - $viewsToBeGenerated = ['index']; // To be generated dynamically |
|
14 | + $viewsToBeGenerated = ['index']; // To be generated dynamically |
|
15 | 15 | |
16 | - $generatedFiles = []; |
|
16 | + $generatedFiles = []; |
|
17 | 17 | |
18 | 18 | foreach ($viewsToBeGenerated as $view) { |
19 | 19 | $viewTemplate = $this->buildTemplate('backend/views/' . $view, [ |
20 | - '{{headings}}' => $this->getHeadings(), |
|
20 | + '{{headings}}' => $this->getHeadings(), |
|
21 | 21 | '{{modelNameLowercase}}' => str_singular($this->module->getModuleName()), |
22 | 22 | '{{moduleName}}' => $this->module->getModuleName() |
23 | 23 | ]); |
@@ -38,20 +38,20 @@ discard block |
||
38 | 38 | $this->insertIntoFile( |
39 | 39 | $mainMenuFile, |
40 | 40 | '{{-- Main Menu --}}', |
41 | - "\n".'<li class="nav-item"><a class="nav-link" href="{{ route("backend.'.$this->module->getModuleName().'.index") }}">'.str_plural($this->module->getModelName()).'</a></li>' |
|
42 | - ); |
|
41 | + "\n".'<li class="nav-item"><a class="nav-link" href="{{ route("backend.'.$this->module->getModuleName().'.index") }}">'.str_plural($this->module->getModelName()).'</a></li>' |
|
42 | + ); |
|
43 | 43 | $generatedFiles = array_merge($generatedFiles, $this->formGenerateCreate()); |
44 | 44 | return $generatedFiles; |
45 | - } |
|
45 | + } |
|
46 | 46 | |
47 | - public function getHeadings(){ |
|
47 | + public function getHeadings(){ |
|
48 | 48 | $columns = $this->module->getBackendColumnTitles(); |
49 | 49 | $headings= ""; |
50 | 50 | foreach ($columns as $column) { |
51 | 51 | $headings .= "<th>".$column."</th>"; |
52 | 52 | } |
53 | - return $headings; |
|
54 | - } |
|
53 | + return $headings; |
|
54 | + } |
|
55 | 55 | |
56 | 56 | public function formGenerateCreate() |
57 | 57 | { |