admin.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. <?php
  2. use Dcat\Admin\Controllers\AuthController;
  3. use Dcat\Admin\Grid\Displayers\DropdownActions;
  4. use Dcat\Admin\Models\Administrator;
  5. use Dcat\Admin\Models\Menu;
  6. use Dcat\Admin\Models\Permission;
  7. use Dcat\Admin\Models\Role;
  8. return [
  9. /*
  10. |--------------------------------------------------------------------------
  11. | dcat-admin name
  12. |--------------------------------------------------------------------------
  13. |
  14. | This value is the name of dcat-admin, This setting is displayed on the
  15. | login page.
  16. |
  17. */
  18. 'name' => 'Dcat Admin',
  19. /*
  20. |--------------------------------------------------------------------------
  21. | dcat-admin logo
  22. |--------------------------------------------------------------------------
  23. |
  24. | The logo of all admin pages. You can also set it as an image by using a
  25. | `img` tag, eg '<img src="http://logo-url" alt="Admin logo">'.
  26. |
  27. */
  28. 'logo' => '<span>Dcat</span> Admin',
  29. /*
  30. |--------------------------------------------------------------------------
  31. | dcat-admin mini logo
  32. |--------------------------------------------------------------------------
  33. |
  34. | The logo of all admin pages when the sidebar menu is collapsed. You can
  35. | also set it as an image by using a `img` tag, eg
  36. | '<img src="http://logo-url" alt="Admin logo">'.
  37. |
  38. */
  39. 'logo-mini' => '<b>Da</b>',
  40. /*
  41. |--------------------------------------------------------------------------
  42. | dcat-admin route settings
  43. |--------------------------------------------------------------------------
  44. |
  45. | The routing configuration of the admin page, including the path prefix,
  46. | the controller namespace, and the default middleware. If you want to
  47. | access through the root path, just set the prefix to empty string.
  48. |
  49. */
  50. 'route' => [
  51. 'prefix' => env('ADMIN_ROUTE_PREFIX', 'admin'),
  52. 'namespace' => 'App\\Admin\\Controllers',
  53. 'middleware' => ['web', 'admin'],
  54. ],
  55. /*
  56. |--------------------------------------------------------------------------
  57. | dcat-admin install directory
  58. |--------------------------------------------------------------------------
  59. |
  60. | The installation directory of the controller and routing configuration
  61. | files of the administration page. The default is `app/Admin`, which must
  62. | be set before running `artisan admin::install` to take effect.
  63. |
  64. */
  65. 'directory' => app_path('Admin'),
  66. /*
  67. |--------------------------------------------------------------------------
  68. | dcat-admin html title
  69. |--------------------------------------------------------------------------
  70. |
  71. | Html title for all pages.
  72. |
  73. */
  74. 'title' => 'Admin',
  75. /*
  76. |--------------------------------------------------------------------------
  77. | Assets hostname
  78. |--------------------------------------------------------------------------
  79. |
  80. */
  81. 'assets_server' => env('ADMIN_ASSETS_SERVER'),
  82. /*
  83. |--------------------------------------------------------------------------
  84. | Cdn setting
  85. |--------------------------------------------------------------------------
  86. |
  87. */
  88. 'cdn' => false,
  89. /*
  90. |--------------------------------------------------------------------------
  91. | Access via `https`
  92. |--------------------------------------------------------------------------
  93. |
  94. | If your page is going to be accessed via https, set it to `true`.
  95. |
  96. */
  97. 'https' => env('ADMIN_HTTPS', false),
  98. /*
  99. |--------------------------------------------------------------------------
  100. | dcat-admin auth setting
  101. |--------------------------------------------------------------------------
  102. |
  103. | Authentication settings for all admin pages. Include an authentication
  104. | guard and a user provider setting of authentication driver.
  105. |
  106. | You can specify a controller for `login` `logout` and other auth routes.
  107. |
  108. */
  109. 'auth' => [
  110. 'controller' => Dcat\Admin\Controllers\AuthController::class,
  111. 'guard' => 'admin',
  112. 'guards' => [
  113. 'admin' => [
  114. 'driver' => 'session',
  115. 'provider' => 'admin',
  116. ],
  117. ],
  118. 'providers' => [
  119. 'admin' => [
  120. 'driver' => 'eloquent',
  121. 'model' => Dcat\Admin\Models\Administrator::class,
  122. ],
  123. ],
  124. // Add "remember me" to login form
  125. 'remember' => true,
  126. // All method to path like: auth/users/*/edit
  127. // or specific method to path like: get:auth/users.
  128. 'except' => [
  129. 'auth/login',
  130. 'auth/logout',
  131. ],
  132. ],
  133. 'grid' => [
  134. /*
  135. |--------------------------------------------------------------------------
  136. | The global Grid action display class.
  137. |--------------------------------------------------------------------------
  138. */
  139. 'grid_action_class' => Dcat\Admin\Grid\Displayers\DropdownActions::class,
  140. ],
  141. /*
  142. |--------------------------------------------------------------------------
  143. | dcat-admin permission setting
  144. |--------------------------------------------------------------------------
  145. |
  146. | Permission settings for all admin pages.
  147. |
  148. */
  149. 'permission' => [
  150. // Whether enable permission.
  151. 'enable' => true,
  152. // All method to path like: auth/users/*/edit
  153. // or specific method to path like: get:auth/users.
  154. 'except' => [
  155. '/',
  156. 'auth/login',
  157. 'auth/logout',
  158. 'auth/setting',
  159. ],
  160. ],
  161. /*
  162. |--------------------------------------------------------------------------
  163. | dcat-admin menu setting
  164. |--------------------------------------------------------------------------
  165. |
  166. */
  167. 'menu' => [
  168. 'cache' => [
  169. // enable cache or not
  170. 'enable' => true,
  171. 'store' => 'file',
  172. ],
  173. // Whether enable menu bind to a permission.
  174. 'bind_permission' => true,
  175. ],
  176. /*
  177. |--------------------------------------------------------------------------
  178. | dcat-admin upload setting
  179. |--------------------------------------------------------------------------
  180. |
  181. | File system configuration for form upload files and images, including
  182. | disk and upload path.
  183. |
  184. */
  185. 'upload' => [
  186. // Disk in `config/filesystem.php`.
  187. 'disk' => 'admin',
  188. // Image and file upload path under the disk above.
  189. 'directory' => [
  190. 'image' => 'images',
  191. 'file' => 'files',
  192. ],
  193. ],
  194. /*
  195. |--------------------------------------------------------------------------
  196. | dcat-admin database settings
  197. |--------------------------------------------------------------------------
  198. |
  199. | Here are database settings for dcat-admin builtin model & tables.
  200. |
  201. */
  202. 'database' => [
  203. // Database connection for following tables.
  204. 'connection' => '',
  205. // User tables and model.
  206. 'users_table' => 'admin_users',
  207. 'users_model' => Dcat\Admin\Models\Administrator::class,
  208. // Role table and model.
  209. 'roles_table' => 'admin_roles',
  210. 'roles_model' => Dcat\Admin\Models\Role::class,
  211. // Permission table and model.
  212. 'permissions_table' => 'admin_permissions',
  213. 'permissions_model' => Dcat\Admin\Models\Permission::class,
  214. // Menu table and model.
  215. 'menu_table' => 'admin_menu',
  216. 'menu_model' => Dcat\Admin\Models\Menu::class,
  217. // Pivot table for table above.
  218. 'operation_log_table' => 'admin_operation_log',
  219. 'user_permissions_table' => 'admin_user_permissions',
  220. 'role_users_table' => 'admin_role_users',
  221. 'role_permissions_table' => 'admin_role_permissions',
  222. 'role_menu_table' => 'admin_role_menu',
  223. 'permission_menu_table' => 'admin_permission_menu',
  224. ],
  225. /*
  226. |--------------------------------------------------------------------------
  227. | User operation log setting
  228. |--------------------------------------------------------------------------
  229. |
  230. | By setting this option to open or close operation log in dcat-admin.
  231. |
  232. */
  233. 'operation_log' => [
  234. 'enable' => true,
  235. // Only logging allowed methods in the list
  236. 'allowed_methods' => ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH'],
  237. // Routes that will not log to database.
  238. // All method to path like: auth/logs/*/edit
  239. // or specific method to path like: get:auth/logs.
  240. 'except' => [
  241. 'auth/logs*',
  242. ],
  243. ],
  244. /*
  245. |--------------------------------------------------------------------------
  246. | Admin map field provider
  247. |--------------------------------------------------------------------------
  248. |
  249. | Supported: "tencent", "google", "yandex".
  250. |
  251. */
  252. 'map_provider' => 'google',
  253. /*
  254. |--------------------------------------------------------------------------
  255. | Application Skin
  256. |--------------------------------------------------------------------------
  257. |
  258. | This value is the skin of admin pages.
  259. | @see https://adminlte.io/docs/2.4/layout
  260. |
  261. | Supported:
  262. | "skin-blue-light", "skin-black", "skin-black-light".
  263. |
  264. */
  265. 'skin' => 'skin-black',
  266. /*
  267. |--------------------------------------------------------------------------
  268. | Application layout
  269. |--------------------------------------------------------------------------
  270. |
  271. | This value is the layout of admin pages.
  272. | @see https://adminlte.io/docs/2.4/layout
  273. |
  274. | Supported: "fixed", "layout-boxed", "layout-top-nav", "sidebar-collapse",
  275. | "sidebar-mini".
  276. |
  277. */
  278. 'layout' => ['sidebar-mini', 'sidebar-collapse', 'fixed'],
  279. /*
  280. |--------------------------------------------------------------------------
  281. | Login page background image
  282. |--------------------------------------------------------------------------
  283. |
  284. | This value is used to set the background image of login page.
  285. |
  286. */
  287. 'login_background_image' => '',
  288. /*
  289. |--------------------------------------------------------------------------
  290. | The exception handler class
  291. |--------------------------------------------------------------------------
  292. |
  293. */
  294. 'exception_handler' => \Dcat\Admin\Exception\Handler::class,
  295. /*
  296. |--------------------------------------------------------------------------
  297. | Enable default breadcrumb
  298. |--------------------------------------------------------------------------
  299. |
  300. | Whether enable default breadcrumb for every page content.
  301. */
  302. 'enable_default_breadcrumb' => true,
  303. /*
  304. |--------------------------------------------------------------------------
  305. | Extension Directory
  306. |--------------------------------------------------------------------------
  307. |
  308. | When you use command `php artisan admin:extend` to generate extensions,
  309. | the extension files will be generated in this directory.
  310. */
  311. 'extension_dir' => app_path('Admin/Extensions'),
  312. /*
  313. |--------------------------------------------------------------------------
  314. | Settings for extensions.
  315. |--------------------------------------------------------------------------
  316. |
  317. | You can find all available extensions here
  318. | https://github.com/dcat-admin-extensions.
  319. |
  320. */
  321. 'extensions' => [
  322. ],
  323. ];