Configuration
Acun UI's settings live in the config/acun-ui.php file. This page shows how to create the file and what each key does.
Quick example
If your application doesn't have the file yet, copy it from the package:
php artisan vendor:publish --tag=acun-ui-config
The settings people change most are the interface language and the look of the layout:
// config/acun-ui.php
'locale' => [
'supported' => ['tr', 'en'],
'fallback' => 'tr', // Turkish when nothing else decides
// …
],
'layout' => [
'theme' => 'light', // light theme on the first visit
'brand_color' => 'green', // primary color
'theme_toggle' => false, // hides the theme button in the top bar
// …
],
These are defaults. The theme and color a user picks in the appearance panel always come first.
Creating the file
vendor:publish copies the package's file to config/acun-ui.php. If you never create the file, the package defaults apply.
A key missing from your file doesn't cause an error; the package default is used for that key. To add a new section to an older file, copy it from vendor/acunsoft/acun-ui-free/config/acun-ui.php. Publishing again with --force replaces the whole file, and your own values are lost.
After changing a setting on a live server, refresh the cache: php artisan optimize. The details are on the Deployment page.
Layout
The layout array holds the default look of the panel layouts. Every key is null in the file. null means the package default shown in the table.
| Key | Default | What it does |
|---|---|---|
theme |
system |
Theme: light, dark, or system to follow the device. |
brand_color |
default |
Primary color: default, green, red, yellow, blue, gray, dark, or #rrggbb. |
skin |
default |
bordered: thin lines instead of shadows. |
semi_dark |
false |
true: a dark menu in the light theme. |
sidebar_mode |
expanded |
Sidebar: expanded or collapsed. |
navbar_mode |
fixed |
Top bar: fixed, static (scrolls with the page), or hidden. |
customizer |
false |
true: shows the appearance panel on the right edge. |
theme_toggle |
true |
false: hides the theme button in the top bar. |
The order of precedence is: a value the page forces (Layout::page()), the user's choice (a layout prop or the browser), this file, the package default.
Note
The theme's layouts turn the appearance panel on with a prop, so the
customizerkey doesn't change them. To remove the panel, delete the wordcustomizerfromresources/views/layouts/admin/vertical.blade.phpandhorizontal.blade.php.
Language
The locale array picks the interface language. For this, the SetLocale middleware must be in the web group; the theme's bootstrap/app.php adds it. The language is picked in this order: the saved choice, the browser's language, the visitor's country, the fallback.
| Key | Default | What it does |
|---|---|---|
supported |
['tr', 'en'] |
The languages offered; the language switcher lists them. |
fallback |
'en' |
The language used when nothing else decides. |
countries |
['TR' => 'tr'] |
Country code and language; any country not listed gets the fallback. |
country_headers |
CF-IPCountry, CloudFront-Viewer-Country, X-Vercel-IP-Country, X-Country-Code |
Request headers the country code is read from. |
cookie |
'acun_locale' |
The name of the cookie that keeps the chosen language. |
user_attribute |
null |
The user attribute that also keeps the choice on the account (null: the cookie only). |
names |
['tr' => 'Türkçe', 'en' => 'English'] |
The names shown in the language switcher. |
flags |
['tr' => 'tr', 'en' => 'gb'] |
Each language's flag: tr, gb, us, de, fr, es, it, nl, or ru. |
DataTable (PRO)
The datatable array holds the defaults of every table. A table can change most of these values in its own class.
| Key | Default | What it does |
|---|---|---|
per_page |
[10, 25, 50, 100] |
The rows-per-page options. |
default_per_page |
25 |
The number of rows shown at first. |
search_debounce |
400 |
How many milliseconds after typing stops the search runs. |
url_state |
true |
Keeps the search, sorting, filters and page size in the address bar. |
sticky_header |
false |
true: the header row stays fixed in every table while the body scrolls inside it. |
pagination |
'paginate' |
Pagination type: paginate, simple, or cursor. |
select_all |
'all' |
The header checkbox: all selects every record matching the filters, page only the visible page. |
selection.max_keys |
5000 |
The most rows that can be ticked one by one. |
actions.enabled |
true |
false: turns off the new action system; only the older Action and BulkAction work. |
density.default |
'normal' |
Row height: compact, normal, or comfortable. |
columns.persist |
'none' |
session: the user's column choice is also kept in the session. |
routes.middleware |
['web', 'auth'] |
The middleware of the download and print routes. |
routes.prefix |
'acun-ui/data-table' |
The URL prefix of these routes. |
The export settings are in datatable.exports:
| Key | Default | What it does |
|---|---|---|
enabled |
true |
false: turns off every export, including files, printing and PDF. |
queue_threshold |
5000 |
Files with more rows than this are built in the queue. |
chunk_size |
1000 |
Rows read from the database at a time. |
disk |
'local' |
The disk the files are written to. |
directory |
'exports' |
The folder on that disk. |
queue |
null |
Queue name (null: the default queue). |
connection |
null |
Queue connection (null: the default connection). |
expire_minutes |
60 |
Lifetime of the download link in minutes; older files are deleted. |
poll_seconds |
3 |
How often, in seconds, the table checks a queued export. |
cache_store |
null |
The cache that keeps the export's status; it must be shared with the queue worker. |
csv_delimiter |
';' |
The separator in CSV files. |
copy_max_rows |
1000 |
The most rows that can be copied to the clipboard. |
per_minute |
30 |
Prints, downloads and copies one user may start per minute. |
drivers |
csv, json |
The driver class of each download format. PDF has no driver; it opens the print page. |
The PDF action opens the print page; the browser's "Save as PDF" option creates the file. No extra package is needed. The row limit comes from print.max_rows. The exports.pdf key left from older versions (max_rows, orientation, paper, title, footer) is no longer read; you can delete it from your published file.
The print settings are in datatable.print:
| Key | Default | What it does |
|---|---|---|
layout |
'acun-ui-pro::components.data-table.print' |
The view of the print page. |
max_rows |
2000 |
The most rows on the print page. PDF uses this page too. |
token_minutes |
10 |
Lifetime of the print link in minutes. |
Search (PRO)
The search array configures the search of DataTables and list pages.
| Key | Default | What it does |
|---|---|---|
driver |
'database' |
Search driver: database, a name from drivers, or the name of a SearchDriver class; read from the ACUN_UI_SEARCH_DRIVER environment variable. |
drivers |
[] |
Your own drivers: name and class. |
suffix |
'_search' |
The suffix added to a search column's name (email → email_search). |
length |
255 |
The length of a search column (0: text). |
max_length |
200 |
The most characters of a search term that are used. |
max_words |
10 |
The most words of a search term that are used. |
verify_columns |
null |
The check that reports a missing search column (null: only in the local and testing environments). |
JavaScript file URLs
The assets and pro.assets arrays set the URLs of the JavaScript files that ship with the packages, for applications without Vite. The theme script (acun-ui-boot.js) comes from here in every application.
| Key | Default | What it does |
|---|---|---|
assets.prefix |
'acun-ui' |
The URL prefix of the files: /acun-ui/acun-ui-boot.js, /acun-ui/acun-ui.js. |
assets.url |
null |
A CDN folder holding the files; when set, it comes first. |
pro.assets.prefix |
'acun-ui' |
The URL prefix of the PRO file: /acun-ui/acun-ui-pro.js. |
pro.assets.url |
null |
The full CDN URL of the PRO file; when set, it comes first. |
Environment variables
The only environment variable the package reads is ACUN_UI_SEARCH_DRIVER. Use it to pick your own search driver per environment:
ACUN_UI_SEARCH_DRIVER=elastic
To change another setting per environment, use env() on that line. For example, 'theme' => env('ACUN_UI_THEME').
Learn more
- Customization: colors, fonts and layout defaults.
- Layouts: layout props and saving user preferences.
- Languages and translation: picking the language and translation files.
- DataTable: all options: settings you change in the table class.
- Search: search columns and drivers.
- CSS, JavaScript and build:
@acunUiScriptsand publishing the files.