|
@@ 94-101 (lines=8) @@
|
| 91 |
|
$transPrefix = $this->variables['%VIEW_NAMESPACE%'] . $this->variables['%RESOURCE_NAME_PLURAL%']; |
| 92 |
|
$columns = ''; |
| 93 |
|
|
| 94 |
|
foreach ($this->variables['%COLUMNS%'] as $column) { |
| 95 |
|
if (in_array($column, (new $this->variables['%RESOURCE_MODEL%'])->getHidden())) { |
| 96 |
|
continue; |
| 97 |
|
} |
| 98 |
|
|
| 99 |
|
$columns .= "\n\t\t\t\t\t<tr><th width=\"25%\">@lang('{$transPrefix}.fields.{$column}')</th>" . |
| 100 |
|
"<td>{{ \${$this->variables['%RESOURCE_NAME_SINGULAR%']}->{$column} }}</td></tr>"; |
| 101 |
|
} |
| 102 |
|
|
| 103 |
|
foreach (['index', 'show', 'edit', 'create'] as $view) { |
| 104 |
|
$this->createFromStub( |
|
@@ 158-164 (lines=7) @@
|
| 155 |
|
{ |
| 156 |
|
$columns = "\n\t\t'id' => '#',"; |
| 157 |
|
|
| 158 |
|
foreach ($this->variables['%COLUMNS%'] as $column) { |
| 159 |
|
if (in_array($column, (new $this->variables['%RESOURCE_MODEL%'])->getHidden())) { |
| 160 |
|
continue; |
| 161 |
|
} |
| 162 |
|
|
| 163 |
|
$columns .= "\n\t\t'{$column}' => '{$column}',"; |
| 164 |
|
} |
| 165 |
|
|
| 166 |
|
$this->createFromStub( |
| 167 |
|
__DIR__ . '/../../stubs/resource.stub', |
|
@@ 182-188 (lines=7) @@
|
| 179 |
|
$transPrefix = $this->variables['%VIEW_NAMESPACE%'] . $this->variables['%RESOURCE_NAME_PLURAL%']; |
| 180 |
|
$columns = "\n\t\t\tColumn::make('id')->title(trans('{$transPrefix}.fields.id'))->width('1%'),"; |
| 181 |
|
|
| 182 |
|
foreach ($this->variables['%COLUMNS%'] as $column) { |
| 183 |
|
if (in_array($column, (new $this->variables['%RESOURCE_MODEL%'])->getHidden())) { |
| 184 |
|
continue; |
| 185 |
|
} |
| 186 |
|
|
| 187 |
|
$columns .= "\n\t\t\tColumn::make('{$column}')->title(trans('{$transPrefix}.fields.{$column}')),"; |
| 188 |
|
} |
| 189 |
|
|
| 190 |
|
$this->createFromStub( |
| 191 |
|
__DIR__ . '/../../stubs/resource-datatable.stub', |