@@ -73,7 +73,7 @@ |
||
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - protected function configToGenerators($array){ |
|
| 76 | + protected function configToGenerators($array) { |
|
| 77 | 77 | $generators = []; |
| 78 | 78 | foreach ($array as $ns => $items) { |
| 79 | 79 | foreach ($items as $item) { |
@@ -8,13 +8,13 @@ discard block |
||
| 8 | 8 | {
|
| 9 | 9 | public function generate() |
| 10 | 10 | {
|
| 11 | - $viewsToBeGenerated = ['index']; // To be generated dynamically |
|
| 11 | + $viewsToBeGenerated = ['index']; // To be generated dynamically |
|
| 12 | 12 | |
| 13 | - $generatedFiles = []; |
|
| 13 | + $generatedFiles = []; |
|
| 14 | 14 | |
| 15 | 15 | foreach ($viewsToBeGenerated as $view) {
|
| 16 | 16 | $viewTemplate = $this->buildTemplate('Backend/Views/' . $view, [
|
| 17 | - '{{headings}}' => $this->getHeadings(),
|
|
| 17 | + '{{headings}}' => $this->getHeadings(),
|
|
| 18 | 18 | '{{modelNameLowercase}}' => str_singular($this->module->getModuleName()),
|
| 19 | 19 | '{{moduleName}}' => $this->module->getModuleName()
|
| 20 | 20 | ]); |
@@ -32,18 +32,18 @@ discard block |
||
| 32 | 32 | $this->insertIntoFile( |
| 33 | 33 | $mainMenuFile, |
| 34 | 34 | "{{-- Main Menu --}}",
|
| 35 | - "" |
|
| 36 | - ); |
|
| 35 | + "" |
|
| 36 | + ); |
|
| 37 | 37 | |
| 38 | 38 | return $generatedFiles; |
| 39 | - } |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - public function getHeadings(){
|
|
| 41 | + public function getHeadings(){
|
|
| 42 | 42 | $columns = $this->module->getBackendColumnTitles(); |
| 43 | 43 | $headings= ""; |
| 44 | 44 | foreach ($columns as $column) {
|
| 45 | 45 | $headings .= "<th>".$column."</th>"; |
| 46 | 46 | } |
| 47 | - return $headings; |
|
| 48 | - } |
|
| 47 | + return $headings; |
|
| 48 | + } |
|
| 49 | 49 | } |
@@ -13,15 +13,15 @@ discard block |
||
| 13 | 13 | $generatedFiles = []; |
| 14 | 14 | |
| 15 | 15 | foreach ($viewsToBeGenerated as $view) {
|
| 16 | - $viewTemplate = $this->buildTemplate('Backend/Views/' . $view, [
|
|
| 16 | + $viewTemplate = $this->buildTemplate('Backend/Views/'.$view, [
|
|
| 17 | 17 | '{{headings}}' => $this->getHeadings(),
|
| 18 | 18 | '{{modelNameLowercase}}' => str_singular($this->module->getModuleName()),
|
| 19 | 19 | '{{moduleName}}' => $this->module->getModuleName()
|
| 20 | 20 | ]); |
| 21 | 21 | |
| 22 | - $fullFilePath = $this->getPath("resources/views/backend/" . $this->module->getModuleName()) . "/{$view}.blade.php";
|
|
| 22 | + $fullFilePath = $this->getPath("resources/views/backend/".$this->module->getModuleName())."/{$view}.blade.php";
|
|
| 23 | 23 | file_put_contents($fullFilePath, $viewTemplate); |
| 24 | - $generatedFiles[] = $fullFilePath; |
|
| 24 | + $generatedFiles[] = $fullFilePath; |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | $mainMenuFile = $this->getPath("resources/views/backend/includes/")."main_menu.blade.php";
|
@@ -38,9 +38,9 @@ discard block |
||
| 38 | 38 | return $generatedFiles; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - public function getHeadings(){
|
|
| 41 | + public function getHeadings() {
|
|
| 42 | 42 | $columns = $this->module->getBackendColumnTitles(); |
| 43 | - $headings= ""; |
|
| 43 | + $headings = ""; |
|
| 44 | 44 | foreach ($columns as $column) {
|
| 45 | 45 | $headings .= "<th>".$column."</th>"; |
| 46 | 46 | } |
@@ -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 | } |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | return $fullFilePath; |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | - protected function getRules(){
|
|
| 22 | + protected function getRules() {
|
|
| 23 | 23 | // Todo |
| 24 | 24 | return ""; |
| 25 | 25 | } |
@@ -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, |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | $webRouteFile = $this->getPath("routes/frontend/")."web.php";
|
| 18 | 18 | $backendWebRouteFile = $this->getPath("routes/backend/")."web.php";
|
| 19 | 19 | |
| 20 | - if(self::$initializeFlag++ == 0){
|
|
| 20 | + if (self::$initializeFlag++ == 0) {
|
|
| 21 | 21 | $this->initializeFiles([ |
| 22 | 22 | $webRouteFile => "Route", |
| 23 | 23 | $backendAuthRouteFile => "Routes/Backend-auth", |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | $this->insertIntoFile( |
| 45 | 45 | $webRouteFile, |
| 46 | - "/" . "* Insert your routes here */", |
|
| 46 | + "/"."* Insert your routes here */", |
|
| 47 | 47 | "\n".$this->getTabs(1)."Route::resource('".$this->module->getModuleName()."', ".$this->module->getModelName()."Controller::class);"
|
| 48 | 48 | ); |
| 49 | 49 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | $this->insertIntoFile( |
| 59 | 59 | $backendWebRouteFile, |
| 60 | - "/" . "* Insert your routes here */", |
|
| 60 | + "/"."* Insert your routes here */", |
|
| 61 | 61 | "\n".$this->getTabs(1)."Route::resource('".$this->module->getModuleName()."', ".$this->module->getModelName()."Controller::class);"
|
| 62 | 62 | ); |
| 63 | 63 | |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | $data = ['S.N.']; |
| 35 | 35 | foreach ($this->data as $column => $optionString) { |
| 36 | 36 | $optionArray = explode(':', $optionString); |
| 37 | - if (in_array($optionArray[0], ['string', 'int'])&&in_array($column, ['title', 'firstname', 'lastname', 'name'])) { |
|
| 37 | + if (in_array($optionArray[0], ['string', 'int']) && in_array($column, ['title', 'firstname', 'lastname', 'name'])) { |
|
| 38 | 38 | $data[] = ucwords($column); |
| 39 | 39 | } |
| 40 | 40 | } |