admin.php 11 KB

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