From c0e7c6dfa9a4fcb4cf7ff187f5831cb9318febff Mon Sep 17 00:00:00 2001
From: liapples
Date: Thu, 19 Aug 2021 14:19:47 +0800
Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=AE=B6=E5=85=A5=E9=A9=BB=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controllers/AgentController.php | 112 ++++++
.../Controllers/AuthController.php | 9 +
.../Controllers/GuideController.php | 95 +++++
.../Controllers/HomeController.php | 26 ++
.../Controllers/SupplierController.php | 98 +++++
.../Metrics/Examples/NewDevices.php | 100 +++++
.../Metrics/Examples/NewUsers.php | 108 ++++++
.../Metrics/Examples/ProductOrders.php | 114 ++++++
.../Metrics/Examples/Sessions.php | 117 ++++++
app/AdminSettled/Metrics/Examples/Tickets.php | 116 ++++++
.../Metrics/Examples/TotalUsers.php | 129 +++++++
app/AdminSettled/bootstrap.php | 26 ++
app/AdminSettled/routes.php | 17 +
config/admin-settled.php | 353 ++++++++++++++++++
14 files changed, 1420 insertions(+)
create mode 100644 app/AdminSettled/Controllers/AgentController.php
create mode 100644 app/AdminSettled/Controllers/AuthController.php
create mode 100644 app/AdminSettled/Controllers/GuideController.php
create mode 100644 app/AdminSettled/Controllers/HomeController.php
create mode 100644 app/AdminSettled/Controllers/SupplierController.php
create mode 100644 app/AdminSettled/Metrics/Examples/NewDevices.php
create mode 100644 app/AdminSettled/Metrics/Examples/NewUsers.php
create mode 100644 app/AdminSettled/Metrics/Examples/ProductOrders.php
create mode 100644 app/AdminSettled/Metrics/Examples/Sessions.php
create mode 100644 app/AdminSettled/Metrics/Examples/Tickets.php
create mode 100644 app/AdminSettled/Metrics/Examples/TotalUsers.php
create mode 100644 app/AdminSettled/bootstrap.php
create mode 100644 app/AdminSettled/routes.php
create mode 100644 config/admin-settled.php
diff --git a/app/AdminSettled/Controllers/AgentController.php b/app/AdminSettled/Controllers/AgentController.php
new file mode 100644
index 0000000..59a9637
--- /dev/null
+++ b/app/AdminSettled/Controllers/AgentController.php
@@ -0,0 +1,112 @@
+供应商入驻》
+ 《代理商入驻》
+ 《地接入驻》';
+ return Alert::make($tip, '页面不存在')->danger();
+ }
+
+ /**
+ * Make a show builder.
+ *
+ * @param mixed $id
+ */
+ protected function detail($id)
+ {
+ config::set('admin.helpers.enable', false);
+ return Alert::make('', '页面不存在')->danger();
+ }
+
+ /**
+ * Make a form builder.
+ *
+ * @return Form
+ */
+ protected function form()
+ {
+ config::set('admin.helpers.enable', false);
+ return Form::make(new Agent(), function (Form $form) {
+ $form->disableListButton();
+ $form->disableViewCheck();
+ $form->disableCreatingCheck();
+ $form->disableEditingCheck();
+ $form->disableDeleteButton();
+
+ $form->text('username')->required();
+ $form->text('password')->required();
+ $form->text('name')->required();
+ $form->text('appid')->placeholder('可以先不填,审核通过之后再设置');
+ $form->text('appsecret')->placeholder('可以先不填,审核通过之后再设置');
+ $form->text('mchid')->placeholder('可以先不填,审核通过之后再设置');
+ $form->text('mchkey')->placeholder('可以先不填,审核通过之后再设置');
+ $form->radio('type')
+ ->options(AgentType::array())
+ ->default(AgentType::OPERATOR)
+ ->required();
+ $form->text('company_name')->required();
+ $form->image('logo')->required();
+ $form->text('address')->required();
+ $form->image('license_pic')->required();
+ $form->text('director')->required();
+ $form->text('contact_phone')->required();
+ })->saving(function (Form $form) {
+ if ($form->isEditing()) {
+ return $form->response()->error('服务器出错了~~');
+ }
+
+ //判断账号是否唯一
+ if ($form->repository()->model()->where('username', $form->username)->exists()) {
+ return $form->response()->error($form->username . ' 的账号已经存在');
+ }
+
+ //不允许编辑的字段
+ if ($form->isEditing()) {
+ $form->ignore(['id', 'remember_token', 'username', 'rate', 'created_at', 'updated_at', 'deleted_at']);
+ }
+
+ //过滤null字段
+ foreach($form->input() as $k => $v) {
+ if (is_null($v)) {
+ $form->$k = '';
+ }
+ }
+
+ //处理特殊字段
+ $form->status = UserStatus::UNAUDITED;
+ $form->rate = 0.05;
+ $form->appid = $form->appid ?: '暂未填写';
+ $form->appsecret = $form->appsecret ?: '暂未填写';
+ $form->mchid = $form->appid ?: '暂未填写';
+ $form->mchkey = $form->appid ?: '暂未填写';
+ $form->type = in_array($form->type, UserStatus::array()) ? $form->type : AgentType::OPERATOR;
+ })->saved(function (Form $form) {
+ return $form->response()->success('操作成功,请等待管理员审核');
+ })->deleting(function (Form $form) {
+ return $form->response()->error('服务器出错了~~');
+ });
+ }
+}
diff --git a/app/AdminSettled/Controllers/AuthController.php b/app/AdminSettled/Controllers/AuthController.php
new file mode 100644
index 0000000..6aac9ce
--- /dev/null
+++ b/app/AdminSettled/Controllers/AuthController.php
@@ -0,0 +1,9 @@
+供应商入驻》
+ 《代理商入驻》
+ 《地接入驻》';
+ return Alert::make($tip, '页面不存在')->danger();
+ }
+
+ /**
+ * Make a show builder.
+ *
+ * @param mixed $id
+ */
+ protected function detail($id)
+ {
+ config::set('admin.helpers.enable', false);
+ return Alert::make('', '页面不存在')->danger();
+ }
+
+ /**
+ * Make a form builder.
+ *
+ * @return Form
+ */
+ protected function form()
+ {
+ config::set('admin.helpers.enable', false);
+ return Form::make(new Guide(), function (Form $form) {
+ $form->disableListButton();
+ $form->disableViewCheck();
+ $form->disableCreatingCheck();
+ $form->disableEditingCheck();
+ $form->disableDeleteButton();
+
+ $form->text('username')->required();
+ $form->text('password')->required();
+ $form->text('name')->required();
+ $form->image('photo')->required();
+ $form->image('license_pic')->required();
+ $form->text('contact_phone')->required();
+ })->saving(function (Form $form) {
+ //判断账号是否唯一
+ if ($form->isEditing()) {
+ return $form->response()->error('服务器出错了~~');
+ }
+
+ if ($form->repository()->model()->where('username', $form->username)->exists()) {
+ return $form->response()->error($form->username . ' 的账号已经存在');
+ }
+
+ //不允许编辑的字段
+ if ($form->isEditing()) {
+ $form->ignore(['id', 'remember_token', 'username', 'rate', 'created_at', 'updated_at', 'deleted_at']);
+ }
+
+ //过滤null字段
+ foreach ($form->input() as $k => $v) {
+ if (is_null($v)) {
+ $form->$k = '';
+ }
+ }
+
+ //处理特殊字段
+ $form->status = UserStatus::UNAUDITED;
+ $form->rate = 0.05;
+ })->saved(function (Form $form) {
+ return $form->response()->success('操作成功,请等待管理员审核');
+ })->deleting(function (Form $form) {
+ return $form->response()->error('服务器出错了~~');
+ });
+ }
+}
diff --git a/app/AdminSettled/Controllers/HomeController.php b/app/AdminSettled/Controllers/HomeController.php
new file mode 100644
index 0000000..f3ba8fc
--- /dev/null
+++ b/app/AdminSettled/Controllers/HomeController.php
@@ -0,0 +1,26 @@
+供应商入驻
+ 代理商入驻
+ 地接入驻
+HTML;
+ }
+
+ protected function grid()
+ {
+ return Grid::make(new Supplier(), function (Grid $grid) {
+
+ });
+ }
+}
diff --git a/app/AdminSettled/Controllers/SupplierController.php b/app/AdminSettled/Controllers/SupplierController.php
new file mode 100644
index 0000000..3c8e145
--- /dev/null
+++ b/app/AdminSettled/Controllers/SupplierController.php
@@ -0,0 +1,98 @@
+供应商入驻》
+ 《代理商入驻》
+ 《地接入驻》';
+ return Alert::make($tip, '页面不存在')->danger();
+ }
+
+ /**
+ * Make a show builder.
+ *
+ * @param mixed $id
+ */
+ protected function detail($id)
+ {
+ config::set('admin.helpers.enable', false);
+ return Alert::make('', '页面不存在')->danger();
+ }
+
+ /**
+ * Make a form builder.
+ *
+ * @return Form
+ */
+ protected function form()
+ {
+ config::set('admin.helpers.enable', false);
+ return Form::make(new Supplier(), function (Form $form) {
+ $form->disableListButton();
+ $form->disableViewCheck();
+ $form->disableCreatingCheck();
+ $form->disableEditingCheck();
+ $form->disableDeleteButton();
+
+ $form->text('username')->required();
+ $form->text('password')->required();
+ $form->text('name')->required();
+ $form->text('company_name')->required();
+ $form->image('logo');
+ $form->text('address')->required();
+ $form->image('license_pic')->required();
+ $form->text('director')->required();
+ $form->text('contact_phone')->required();
+ })->saving(function (Form $form) {
+ if ($form->isEditing()) {
+ return $form->response()->error('服务器出错了~~');
+ }
+
+ //判断账号是否唯一
+ if ($form->repository()->model()->where('username', $form->username)->exists()) {
+ return $form->response()->error($form->username . ' 的账号已经存在');
+ }
+
+ //不允许编辑的字段
+ if ($form->isEditing()) {
+ $form->ignore(['id', 'remember_token', 'rate', 'created_at', 'created_at', 'deleted_at', 'deleted_at']);
+ }
+
+ //过滤null字段
+ foreach($form->input() as $k => $v) {
+ if (is_null($form->$k)) {
+ $form->$k = '';
+ }
+ }
+
+ //处理特殊字段
+ $form->status = UserStatus::UNAUDITED;
+ $form->rate = 0.1;
+ })->saved(function (Form $form) {
+ return $form->response()->success('操作成功,请等待管理员审核');
+ })->deleting(function (Form $form) {
+ return $form->response()->error('服务器出错了~~');
+ });
+ }
+}
diff --git a/app/AdminSettled/Metrics/Examples/NewDevices.php b/app/AdminSettled/Metrics/Examples/NewDevices.php
new file mode 100644
index 0000000..f7e0ff6
--- /dev/null
+++ b/app/AdminSettled/Metrics/Examples/NewDevices.php
@@ -0,0 +1,100 @@
+primary(), $color->alpha('blue2', 0.5)];
+
+ $this->title('New Devices');
+ $this->subTitle('Last 30 days');
+ $this->chartLabels($this->labels);
+ // 设置图表颜色
+ $this->chartColors($colors);
+ }
+
+ /**
+ * 渲染模板
+ *
+ * @return string
+ */
+ public function render()
+ {
+ $this->fill();
+
+ return parent::render();
+ }
+
+ /**
+ * 写入数据.
+ *
+ * @return void
+ */
+ public function fill()
+ {
+ $this->withContent(44.9, 28.6);
+
+ // 图表数据
+ $this->withChart([44.9, 28.6]);
+ }
+
+ /**
+ * 设置图表数据.
+ *
+ * @param array $data
+ *
+ * @return $this
+ */
+ public function withChart(array $data)
+ {
+ return $this->chart([
+ 'series' => $data
+ ]);
+ }
+
+ /**
+ * 设置卡片头部内容.
+ *
+ * @param mixed $desktop
+ * @param mixed $mobile
+ *
+ * @return $this
+ */
+ protected function withContent($desktop, $mobile)
+ {
+ $blue = Admin::color()->alpha('blue2', 0.5);
+
+ $style = 'margin-bottom: 8px';
+ $labelWidth = 120;
+
+ return $this->content(
+ <<
+
+ {$this->labels[0]}
+
+ {$desktop}
+
+
+
+ {$this->labels[1]}
+
+
{$mobile}
+
+HTML
+ );
+ }
+}
diff --git a/app/AdminSettled/Metrics/Examples/NewUsers.php b/app/AdminSettled/Metrics/Examples/NewUsers.php
new file mode 100644
index 0000000..e4313f1
--- /dev/null
+++ b/app/AdminSettled/Metrics/Examples/NewUsers.php
@@ -0,0 +1,108 @@
+title('New Users');
+ $this->dropdown([
+ '7' => 'Last 7 Days',
+ '28' => 'Last 28 Days',
+ '30' => 'Last Month',
+ '365' => 'Last Year',
+ ]);
+ }
+
+ /**
+ * 处理请求
+ *
+ * @param Request $request
+ *
+ * @return mixed|void
+ */
+ public function handle(Request $request)
+ {
+ $generator = function ($len, $min = 10, $max = 300) {
+ for ($i = 0; $i <= $len; $i++) {
+ yield mt_rand($min, $max);
+ }
+ };
+
+ switch ($request->get('option')) {
+ case '365':
+ // 卡片内容
+ $this->withContent(mt_rand(1000, 5000).'k');
+ // 图表数据
+ $this->withChart(collect($generator(30))->toArray());
+ break;
+ case '30':
+ // 卡片内容
+ $this->withContent(mt_rand(400, 1000).'k');
+ // 图表数据
+ $this->withChart(collect($generator(30))->toArray());
+ break;
+ case '28':
+ // 卡片内容
+ $this->withContent(mt_rand(400, 1000).'k');
+ // 图表数据
+ $this->withChart(collect($generator(28))->toArray());
+ break;
+ case '7':
+ default:
+ // 卡片内容
+ $this->withContent('89.2k');
+ // 图表数据
+ $this->withChart([28, 40, 36, 52, 38, 60, 55,]);
+ }
+ }
+
+ /**
+ * 设置图表数据.
+ *
+ * @param array $data
+ *
+ * @return $this
+ */
+ public function withChart(array $data)
+ {
+ return $this->chart([
+ 'series' => [
+ [
+ 'name' => $this->title,
+ 'data' => $data,
+ ],
+ ],
+ ]);
+ }
+
+ /**
+ * 设置卡片内容.
+ *
+ * @param string $content
+ *
+ * @return $this
+ */
+ public function withContent($content)
+ {
+ return $this->content(
+ <<
+ {$content}
+ {$this->title}
+
+HTML
+ );
+ }
+}
diff --git a/app/AdminSettled/Metrics/Examples/ProductOrders.php b/app/AdminSettled/Metrics/Examples/ProductOrders.php
new file mode 100644
index 0000000..6fdbb1f
--- /dev/null
+++ b/app/AdminSettled/Metrics/Examples/ProductOrders.php
@@ -0,0 +1,114 @@
+title('Product Orders');
+ $this->chartLabels(['Finished', 'Pending', 'Rejected']);
+ $this->dropdown([
+ '7' => 'Last 7 Days',
+ '28' => 'Last 28 Days',
+ '30' => 'Last Month',
+ '365' => 'Last Year',
+ ]);
+ }
+
+ /**
+ * 处理请求
+ *
+ * @param Request $request
+ *
+ * @return mixed|void
+ */
+ public function handle(Request $request)
+ {
+ switch ($request->get('option')) {
+ case '365':
+ case '30':
+ case '28':
+ case '7':
+ default:
+ // 卡片内容
+ $this->withContent(23043, 14658, 4758);
+
+ // 图表数据
+ $this->withChart([70, 52, 26]);
+
+ // 总数
+ $this->chartTotal('Total', 344);
+ }
+ }
+
+ /**
+ * 设置图表数据.
+ *
+ * @param array $data
+ *
+ * @return $this
+ */
+ public function withChart(array $data)
+ {
+ return $this->chart([
+ 'series' => $data,
+ ]);
+ }
+
+ /**
+ * 卡片内容.
+ *
+ * @param int $finished
+ * @param int $pending
+ * @param int $rejected
+ *
+ * @return $this
+ */
+ public function withContent($finished, $pending, $rejected)
+ {
+ return $this->content(
+ <<
+
+
+
+ Finished
+
+
+ {$finished}
+
+
+
+
+
+
+ Pending
+
+
+ {$pending}
+
+
+
+
+
+
+ Rejected
+
+
+ {$rejected}
+
+
+
+HTML
+ );
+ }
+}
diff --git a/app/AdminSettled/Metrics/Examples/Sessions.php b/app/AdminSettled/Metrics/Examples/Sessions.php
new file mode 100644
index 0000000..a61f232
--- /dev/null
+++ b/app/AdminSettled/Metrics/Examples/Sessions.php
@@ -0,0 +1,117 @@
+dark35();
+
+ // 卡片内容宽度
+ $this->contentWidth(5, 7);
+ // 标题
+ $this->title('Avg Sessions');
+ // 设置下拉选项
+ $this->dropdown([
+ '7' => 'Last 7 Days',
+ '28' => 'Last 28 Days',
+ '30' => 'Last Month',
+ '365' => 'Last Year',
+ ]);
+ // 设置图表颜色
+ $this->chartColors([
+ $dark35,
+ $dark35,
+ $color->primary(),
+ $dark35,
+ $dark35,
+ $dark35
+ ]);
+ }
+
+ /**
+ * 处理请求
+ *
+ * @param Request $request
+ *
+ * @return mixed|void
+ */
+ public function handle(Request $request)
+ {
+ switch ($request->get('option')) {
+ case '7':
+ default:
+ // 卡片内容
+ $this->withContent('2.7k', '+5.2%');
+
+ // 图表数据
+ $this->withChart([
+ [
+ 'name' => 'Sessions',
+ 'data' => [75, 125, 225, 175, 125, 75, 25],
+ ],
+ ]);
+ }
+ }
+
+ /**
+ * 设置图表数据.
+ *
+ * @param array $data
+ *
+ * @return $this
+ */
+ public function withChart(array $data)
+ {
+ return $this->chart([
+ 'series' => $data,
+ ]);
+ }
+
+ /**
+ * 设置卡片内容.
+ *
+ * @param string $title
+ * @param string $value
+ * @param string $style
+ *
+ * @return $this
+ */
+ public function withContent($title, $value, $style = 'success')
+ {
+ // 根据选项显示
+ $label = strtolower(
+ $this->dropdown[request()->option] ?? 'last 7 days'
+ );
+
+ $minHeight = '183px';
+
+ return $this->content(
+ <<
+
+
{$title}
+
+ {$value}
+ vs {$label}
+
+
+
+ View Details
+
+HTML
+ );
+ }
+}
diff --git a/app/AdminSettled/Metrics/Examples/Tickets.php b/app/AdminSettled/Metrics/Examples/Tickets.php
new file mode 100644
index 0000000..83975a5
--- /dev/null
+++ b/app/AdminSettled/Metrics/Examples/Tickets.php
@@ -0,0 +1,116 @@
+title('Tickets');
+ $this->height(400);
+ $this->chartHeight(300);
+ $this->chartLabels('Completed Tickets');
+ $this->dropdown([
+ '7' => 'Last 7 Days',
+ '28' => 'Last 28 Days',
+ '30' => 'Last Month',
+ '365' => 'Last Year',
+ ]);
+ }
+
+ /**
+ * 处理请求
+ *
+ * @param Request $request
+ *
+ * @return mixed|void
+ */
+ public function handle(Request $request)
+ {
+ switch ($request->get('option')) {
+ case '365':
+ case '30':
+ case '28':
+ case '7':
+ default:
+ // 卡片内容
+ $this->withContent(162);
+ // 卡片底部
+ $this->withFooter(29, 63, '1d');
+ // 图表数据
+ $this->withChart(83);
+ }
+ }
+
+ /**
+ * 设置图表数据.
+ *
+ * @param int $data
+ *
+ * @return $this
+ */
+ public function withChart(int $data)
+ {
+ return $this->chart([
+ 'series' => [$data],
+ ]);
+ }
+
+ /**
+ * 卡片内容
+ *
+ * @param string $content
+ *
+ * @return $this
+ */
+ public function withContent($content)
+ {
+ return $this->content(
+ <<
+ {$content}
+ Tickets
+
+HTML
+ );
+ }
+
+ /**
+ * 卡片底部内容.
+ *
+ * @param string $new
+ * @param string $open
+ * @param string $response
+ *
+ * @return $this
+ */
+ public function withFooter($new, $open, $response)
+ {
+ return $this->footer(
+ <<
+
+
+
Open Tickets
+
{$open}
+
+
+
Response Time
+
{$response}
+
+
+HTML
+ );
+ }
+}
diff --git a/app/AdminSettled/Metrics/Examples/TotalUsers.php b/app/AdminSettled/Metrics/Examples/TotalUsers.php
new file mode 100644
index 0000000..5dacda3
--- /dev/null
+++ b/app/AdminSettled/Metrics/Examples/TotalUsers.php
@@ -0,0 +1,129 @@
+title('Total Users');
+ $this->dropdown([
+ '7' => 'Last 7 Days',
+ '28' => 'Last 28 Days',
+ '30' => 'Last Month',
+ '365' => 'Last Year',
+ ]);
+ }
+
+ /**
+ * 处理请求.
+ *
+ * @param Request $request
+ *
+ * @return void
+ */
+ public function handle(Request $request)
+ {
+ switch ($request->get('option')) {
+ case '365':
+ $this->content(mt_rand(600, 1500));
+ $this->down(mt_rand(1, 30));
+ break;
+ case '30':
+ $this->content(mt_rand(170, 250));
+ $this->up(mt_rand(12, 50));
+ break;
+ case '28':
+ $this->content(mt_rand(155, 200));
+ $this->up(mt_rand(5, 50));
+ break;
+ case '7':
+ default:
+ $this->content(143);
+ $this->up(15);
+ }
+ }
+
+ /**
+ * @param int $percent
+ *
+ * @return $this
+ */
+ public function up($percent)
+ {
+ return $this->footer(
+ " {$percent}% Increase"
+ );
+ }
+
+ /**
+ * @param int $percent
+ *
+ * @return $this
+ */
+ public function down($percent)
+ {
+ return $this->footer(
+ " {$percent}% Decrease"
+ );
+ }
+
+ /**
+ * 设置卡片底部内容.
+ *
+ * @param string|Renderable|\Closure $footer
+ *
+ * @return $this
+ */
+ public function footer($footer)
+ {
+ $this->footer = $footer;
+
+ return $this;
+ }
+
+ /**
+ * 渲染卡片内容.
+ *
+ * @return string
+ */
+ public function renderContent()
+ {
+ $content = parent::renderContent();
+
+ return <<
+ {$content}
+
+
+ {$this->renderFooter()}
+
+HTML;
+ }
+
+ /**
+ * 渲染卡片底部内容.
+ *
+ * @return string
+ */
+ public function renderFooter()
+ {
+ return $this->toString($this->footer);
+ }
+}
diff --git a/app/AdminSettled/bootstrap.php b/app/AdminSettled/bootstrap.php
new file mode 100644
index 0000000..40cf396
--- /dev/null
+++ b/app/AdminSettled/bootstrap.php
@@ -0,0 +1,26 @@
+
+ *
+ * Bootstraper for Admin.
+ *
+ * Here you can remove builtin form field:
+ *
+ * extend custom field:
+ * Dcat\Admin\Form::extend('php', PHPEditor::class);
+ * Dcat\Admin\Grid\Column::extend('php', PHPEditor::class);
+ * Dcat\Admin\Grid\Filter::extend('php', PHPEditor::class);
+ *
+ * Or require js and css assets:
+ * Admin::css('/packages/prettydocs/css/styles.css');
+ * Admin::js('/packages/prettydocs/js/main.js');
+ *
+ */
diff --git a/app/AdminSettled/routes.php b/app/AdminSettled/routes.php
new file mode 100644
index 0000000..577d201
--- /dev/null
+++ b/app/AdminSettled/routes.php
@@ -0,0 +1,17 @@
+ config('admin.route.prefix'),
+ 'namespace' => config('admin.route.namespace'),
+], function (Router $router) {
+ $router->resource('/', 'SupplierController');
+ $router->resource('supplier', 'SupplierController');
+ $router->resource('agent', 'AgentController');
+ $router->resource('guide', 'GuideController');
+});
diff --git a/config/admin-settled.php b/config/admin-settled.php
new file mode 100644
index 0000000..e818c61
--- /dev/null
+++ b/config/admin-settled.php
@@ -0,0 +1,353 @@
+ '商家入驻',
+
+ /*
+ |--------------------------------------------------------------------------
+ | dcat-admin logo
+ |--------------------------------------------------------------------------
+ |
+ | The logo of all admin pages. You can also set it as an image by using a
+ | `img` tag, eg '
'.
+ |
+ */
+ 'logo' => '
商家入驻',
+
+ /*
+ |--------------------------------------------------------------------------
+ | dcat-admin mini logo
+ |--------------------------------------------------------------------------
+ |
+ | The logo of all admin pages when the sidebar menu is collapsed. You can
+ | also set it as an image by using a `img` tag, eg
+ | '
'.
+ |
+ */
+ 'logo-mini' => '
',
+
+ /*
+ |--------------------------------------------------------------------------
+ | User default avatar
+ |--------------------------------------------------------------------------
+ |
+ | Set a default avatar for newly created users.
+ |
+ */
+ 'default_avatar' => '@admin/images/default-avatar.jpg',
+
+ /*
+ |--------------------------------------------------------------------------
+ | dcat-admin route settings
+ |--------------------------------------------------------------------------
+ |
+ | The routing configuration of the admin page, including the path prefix,
+ | the controller namespace, and the default middleware. If you want to
+ | access through the root path, just set the prefix to empty string.
+ |
+ */
+ 'route' => [
+ 'domain' => env('ADMIN_ROUTE_DOMAIN'),
+
+ 'prefix' => 'admin-settled',
+
+ 'namespace' => 'App\\AdminSettled\\Controllers',
+
+ 'middleware' => ['web', 'admin'],
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | dcat-admin install directory
+ |--------------------------------------------------------------------------
+ |
+ | The installation directory of the controller and routing configuration
+ | files of the administration page. The default is `app/Admin`, which must
+ | be set before running `artisan admin::install` to take effect.
+ |
+ */
+ 'directory' => app_path('AdminSettled'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | dcat-admin html title
+ |--------------------------------------------------------------------------
+ |
+ | Html title for all pages.
+ |
+ */
+ 'title' => 'Admin',
+
+ /*
+ |--------------------------------------------------------------------------
+ | Assets hostname
+ |--------------------------------------------------------------------------
+ |
+ */
+ 'assets_server' => env('ADMIN_ASSETS_SERVER'),
+
+ /*
+ |--------------------------------------------------------------------------
+ | Access via `https`
+ |--------------------------------------------------------------------------
+ |
+ | If your page is going to be accessed via https, set it to `true`.
+ |
+ */
+ 'https' => env('ADMIN_HTTPS', false),
+
+ /*
+ |--------------------------------------------------------------------------
+ | dcat-admin auth setting
+ |--------------------------------------------------------------------------
+ |
+ | Authentication settings for all admin pages. Include an authentication
+ | guard and a user provider setting of authentication driver.
+ |
+ | You can specify a controller for `login` `logout` and other auth routes.
+ |
+ */
+ 'auth' => [
+ 'enable' => true,
+
+ 'controller' => App\AdminSettled\Controllers\AuthController::class,
+
+ 'guard' => 'admin-settled',
+
+ 'guards' => [
+ 'admin-settled' => [
+ 'driver' => 'session',
+ 'provider' => 'admin-settled',
+ ],
+ ],
+
+ 'providers' => [
+ 'admin-settled' => [
+ 'driver' => 'eloquent',
+ 'model' => Dcat\Admin\Models\Administrator::class,
+ ],
+ ],
+
+ // Add "remember me" to login form
+ 'remember' => true,
+
+ // All method to path like: auth/users/*/edit
+ // or specific method to path like: get:auth/users.
+ 'except' => [
+ '/',
+ 'auth/login',
+ 'auth/logout',
+ 'supplier',
+ 'supplier/create',
+ 'agent',
+ 'agent/create',
+ 'guide',
+ 'guide/create',
+ ],
+
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | The global Grid setting
+ |--------------------------------------------------------------------------
+ */
+ 'grid' => [
+
+ // The global Grid action display class.
+ 'grid_action_class' => Dcat\Admin\Grid\Displayers\DropdownActions::class,
+
+ // The global Grid batch action display class.
+ 'batch_action_class' => Dcat\Admin\Grid\Tools\BatchActions::class,
+
+ // The global Grid pagination display class.
+ 'paginator_class' => Dcat\Admin\Grid\Tools\Paginator::class,
+
+ 'actions' => [
+ 'view' => Dcat\Admin\Grid\Actions\Show::class,
+ 'edit' => Dcat\Admin\Grid\Actions\Edit::class,
+ 'quick_edit' => Dcat\Admin\Grid\Actions\QuickEdit::class,
+ 'delete' => Dcat\Admin\Grid\Actions\Delete::class,
+ 'batch_delete' => Dcat\Admin\Grid\Tools\BatchDelete::class,
+ ],
+
+ // The global Grid column selector setting.
+ 'column_selector' => [
+ 'store' => Dcat\Admin\Grid\ColumnSelector\SessionStore::class,
+ 'store_params' => [
+ 'driver' => 'file',
+ ],
+ ],
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | dcat-admin helpers setting.
+ |--------------------------------------------------------------------------
+ */
+ 'helpers' => [
+ 'enable' => true,
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | dcat-admin permission setting
+ |--------------------------------------------------------------------------
+ |
+ | Permission settings for all admin pages.
+ |
+ */
+ 'permission' => [
+ // Whether enable permission.
+ 'enable' => true,
+
+ // All method to path like: auth/users/*/edit
+ // or specific method to path like: get:auth/users.
+ 'except' => [
+ '/',
+ 'auth/login',
+ 'auth/logout',
+ 'auth/setting',
+ ],
+
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | dcat-admin menu setting
+ |--------------------------------------------------------------------------
+ |
+ */
+ 'menu' => [
+ 'cache' => [
+ // enable cache or not
+ 'enable' => false,
+ 'store' => 'file',
+ ],
+
+ // Whether enable menu bind to a permission.
+ 'bind_permission' => true,
+
+ // Whether enable role bind to menu.
+ 'role_bind_menu' => true,
+
+ // Whether enable permission bind to menu.
+ 'permission_bind_menu' => true,
+
+ 'default_icon' => 'feather icon-circle',
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | dcat-admin upload setting
+ |--------------------------------------------------------------------------
+ |
+ | File system configuration for form upload files and images, including
+ | disk and upload path.
+ |
+ */
+ 'upload' => [
+
+ // Disk in `config/filesystem.php`.
+ 'disk' => 'public',
+
+ // Image and file upload path under the disk above.
+ 'directory' => [
+ 'image' => 'images',
+ 'file' => 'files',
+ ],
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | dcat-admin database settings
+ |--------------------------------------------------------------------------
+ |
+ | Here are database settings for dcat-admin builtin model & tables.
+ |
+ */
+ 'database' => [
+
+ // Database connection for following tables.
+ 'connection' => '',
+
+ // User tables and model.
+ 'users_table' => 'admin_settled_users',
+ 'users_model' => Dcat\Admin\Models\Administrator::class,
+
+ // Role table and model.
+ 'roles_table' => 'admin_settled_roles',
+ 'roles_model' => Dcat\Admin\Models\Role::class,
+
+ // Permission table and model.
+ 'permissions_table' => 'admin_settled_permissions',
+ 'permissions_model' => Dcat\Admin\Models\Permission::class,
+
+ // Menu table and model.
+ 'menu_table' => 'admin_settled_menu',
+ 'menu_model' => Dcat\Admin\Models\Menu::class,
+
+ // Pivot table for table above.
+ 'role_users_table' => 'admin_settled_role_users',
+ 'role_permissions_table' => 'admin_settled_role_permissions',
+ 'role_menu_table' => 'admin_settled_role_menu',
+ 'permission_menu_table' => 'admin_settled_permission_menu',
+ 'settings_table' => 'admin_settled_settings',
+ 'extensions_table' => 'admin_settled_extensions',
+ 'extension_histories_table' => 'admin_settled_extension_histories',
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | Application layout
+ |--------------------------------------------------------------------------
+ |
+ | This value is the layout of admin pages.
+ */
+ 'layout' => [
+ // default, blue, blue-light, green
+ 'color' => 'default',
+
+ // sidebar-separate
+ 'body_class' => [],
+
+ 'horizontal_menu' => false,
+
+ 'sidebar_collapsed' => false,
+
+ // light, primary, dark
+ 'sidebar_style' => 'light',
+
+ 'dark_mode_switch' => false,
+
+ // bg-primary, bg-info, bg-warning, bg-success, bg-danger, bg-dark
+ 'navbar_color' => '',
+ ],
+
+ /*
+ |--------------------------------------------------------------------------
+ | The exception handler class
+ |--------------------------------------------------------------------------
+ |
+ */
+ 'exception_handler' => Dcat\Admin\Http\Exception\Handler::class,
+
+ /*
+ |--------------------------------------------------------------------------
+ | Enable default breadcrumb
+ |--------------------------------------------------------------------------
+ |
+ | Whether enable default breadcrumb for every page content.
+ */
+ 'enable_default_breadcrumb' => false,
+];