|
@@ -26,6 +26,13 @@ class AdminController extends Controller
|
|
|
// 'create' => 'Create',
|
|
|
];
|
|
|
|
|
|
+ /**
|
|
|
+ * Set translation path.
|
|
|
+ *
|
|
|
+ * @var string
|
|
|
+ */
|
|
|
+ protected $translation;
|
|
|
+
|
|
|
/**
|
|
|
* Get content title.
|
|
|
*
|
|
@@ -46,6 +53,16 @@ class AdminController extends Controller
|
|
|
return $this->description;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Get translation path.
|
|
|
+ *
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ protected function translation()
|
|
|
+ {
|
|
|
+ return $this->translation;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Index interface.
|
|
|
*
|
|
@@ -56,6 +73,7 @@ class AdminController extends Controller
|
|
|
public function index(Content $content)
|
|
|
{
|
|
|
return $content
|
|
|
+ ->translation($this->translation())
|
|
|
->title($this->title())
|
|
|
->description($this->description()['index'] ?? trans('admin.list'))
|
|
|
->body($this->grid());
|
|
@@ -72,6 +90,7 @@ class AdminController extends Controller
|
|
|
public function show($id, Content $content)
|
|
|
{
|
|
|
return $content
|
|
|
+ ->translation($this->translation())
|
|
|
->title($this->title())
|
|
|
->description($this->description()['show'] ?? trans('admin.show'))
|
|
|
->body($this->detail($id));
|
|
@@ -88,6 +107,7 @@ class AdminController extends Controller
|
|
|
public function edit($id, Content $content)
|
|
|
{
|
|
|
return $content
|
|
|
+ ->translation($this->translation())
|
|
|
->title($this->title())
|
|
|
->description($this->description()['edit'] ?? trans('admin.edit'))
|
|
|
->body($this->form()->edit($id));
|
|
@@ -103,6 +123,7 @@ class AdminController extends Controller
|
|
|
public function create(Content $content)
|
|
|
{
|
|
|
return $content
|
|
|
+ ->translation($this->translation())
|
|
|
->title($this->title())
|
|
|
->description($this->description()['create'] ?? trans('admin.create'))
|
|
|
->body($this->form());
|