Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add trans #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions src/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class ConfigController
public function index()
{
return Admin::content(function (Content $content) {
$content->header('Config');
$content->description('Config list..');
$content->header(trans('admin.config.header'));
$content->description(trans('admin.config.description'));

$content->body($this->grid());
});
Expand All @@ -37,8 +37,9 @@ public function index()
public function edit($id)
{
return Admin::content(function (Content $content) use ($id) {
$content->header('header');
$content->description('description');
$configDatabaseItem = ConfigModel::find($id);
$content->header(trans('admin.config.header'));
$content->description($configDatabaseItem->name);

$content->body($this->form()->edit($id));
});
Expand All @@ -52,8 +53,8 @@ public function edit($id)
public function create()
{
return Admin::content(function (Content $content) {
$content->header('header');
$content->description('description');
$content->header(trans('admin.config.header'));
$content->description(trans('admin.create'));

$content->body($this->form());
});
Expand All @@ -63,19 +64,19 @@ public function grid()
{
return Admin::grid(ConfigModel::class, function (Grid $grid) {
$grid->id('ID')->sortable();
$grid->name()->display(function ($name) {
$grid->column('name', trans('admin.name'))->display(function ($name) {
return "<a tabindex=\"0\" class=\"btn btn-xs btn-twitter\" role=\"button\" data-toggle=\"popover\" data-html=true title=\"Usage\" data-content=\"<code>config('$name');</code>\">$name</a>";
});
$grid->value();
$grid->description();
$grid->column('value' , trans('admin.value'));
$grid->column('description', trans('admin.description'));

$grid->created_at();
$grid->updated_at();
# $grid->created_at();
# $grid->updated_at();

$grid->filter(function ($filter) {
$filter->disableIdFilter();
$filter->like('name');
$filter->like('value');
$filter->like('name' , trans('admin.value'));
$filter->like('value', trans('admin.description'));
});
});
}
Expand All @@ -84,12 +85,12 @@ public function form()
{
return Admin::form(ConfigModel::class, function (Form $form) {
$form->display('id', 'ID');
$form->text('name')->rules('required');
$form->textarea('value')->rules('required');
$form->textarea('description');
$form->text ('name' , trans('admin.value'))->rules('required');
$form->textarea('value' , trans('admin.value'))->rules('required');
$form->textarea('description', trans('admin.description'));

$form->display('created_at');
$form->display('updated_at');
$form->display('created_at' , trans('admin.created_at'));
$form->display('updated_at' , trans('admin.updated_at'));
});
}
}