Skip to content

Commit

Permalink
fix select generator and table query
Browse files Browse the repository at this point in the history
  • Loading branch information
3x1io committed Dec 11, 2023
1 parent 125952e commit 2231f74
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Services/Generator/Concerns/GenerateForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private function generateForm(bool $view=false): string
}
else {
$itemLable=($item['relation']['relationColumnType'] == 'json')?'name.'.app()->getLocale():'name';
$form .= "<x-splade-select :label=\"__('".Str::ucfirst(str_replace('_', ' ', $item['name']))."')\" :placeholder=\"__('".Str::ucfirst(str_replace('_', ' ', $item['name']))."')\" name=\"".$item['name']."\" remote-url=\"/admin/".$item['relation']['table']."/api\" remote-root=\"model.data\" option-label=$itemLable option-value=\"id\" choices/>";
$form .= "<x-splade-select :label=\"__('".Str::ucfirst(str_replace('_', ' ', $item['name']))."')\" :placeholder=\"__('".Str::ucfirst(str_replace('_', ' ', $item['name']))."')\" name=\"".$item['name']."\" remote-url=\"/admin/".$item['relation']['table']."/api\" remote-root=\"data\" option-label=\"$itemLable\" option-value=\"id\" choices/>";
}
}
if($item['type'] === 'date'){
Expand Down
2 changes: 1 addition & 1 deletion stubs/table.stub
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class {{ name }} extends AbstractTable
*
* @return void
*/
public function __construct(public Builder|null $query=null)
public function __construct(public mixed $query=null)
{
if(!$query){
$this->query = {{ model }}::query();
Expand Down
2 changes: 1 addition & 1 deletion stubs/view.stub
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<x-tomato-admin-container label="{{trans('tomato-admin::global.crud.view')}} {{__('{{ table }}')}} #{{$model->id}}">
<x-tomato-admin-container label="{{trans('tomato-admin::global.crud.view')}} {{__('{{ title }}')}} #{{$model->id}}">
<div class="grid grid-cols-1 lg:grid-cols-2 gap-4">
{{ cols }}
</div>
Expand Down

0 comments on commit 2231f74

Please sign in to comment.