Repository navigation
Releases
Releases · dskripchenko/laravel-admin
v1.77.0
Added
Action::keepsRecord(): an action that leaves its record open. With
Layout::resourceIndex()->nextAfterAction()every action run in the record
drawer moved on to the next record — a comment or a reminder too. An action
marked->keepsRecord()leaves the record open (the list still reloads).
The action's method may decide per run:['keep_record' => true|false]in
its array answer is passed in the{slug}/actionresponse
(AffectedPayload.keep_record) and wins over the flag. Unmarked actions
move on as before.Wysiwyg::sanitizerAllow(): a field's own sanitizer whitelist. The
whitelist was fixed inside the package (the default one plus the engine's
markup) and the field class is final.->sanitizerAllow(['a' => ['style']])
merges tag => attributes over it per field; a tag not on the list yet
becomes allowed.on*handlers,srcdoc, malformed names and the tags the
sanitizer removes with their content (script,style,iframe,
object,form…) are refused with anInvalidArgumentException.PermissionRegistry::label($key)and the static
PermissionRegistry::labelOf($key): a permission's label in the current
locale, the key when no group declares it.
Changed
- Refusals name the missing permission by its label. «Нет права
:permission» and «Доступ запрещён: :permission» (AdminAccess, impersonation,
role preview, actions, the form listener, import, delayed processes) put the
raw key into the message; they now use the label from the permission
registry, falling back to the key. Thepermissionfield of the 403
answers keeps the key. - The bundle size budget is raised to 265 KB per bundle (from 260): the
ESM bundle stood at 259.9 KB after 1.76.0, and the record drawer's
keepsRecordhandling took it a few hundred bytes over.
Security
HtmlSanitizerhardening. Anon*handler is dropped even when a
whitelist names it; every address attribute (srcset,ping,poster,
formaction,action,background,cite,data,longdesc,
usemap,xlink:href, besideshrefandsrc) is checked for
javascript:,vbscript:anddata:text/html; whitespace and control
characters inside a scheme (java	script:), which browsers skip, no
longer hide it.
v1.76.0
A minor release rather than a patch: the audit log's morph ids become strings
(see the migration guide) — a raw query comparing subject_id/actor_id with
an integer on PostgreSQL has to compare with a string or use
forSubject()/forActor().
Fixed
- Auditing a record with a uuid or string key failed with a 500. The
audit log's morph ids werebigint(nullableMorphs), so on PostgreSQL any
entry about such a record —{slug}/revealof a masked column, a
Loggablechange, an impersonation of a uuid-keyed user — failed with
invalid input syntax for type bigint, and the request with it (MySQL refused
or truncated it, depending on its SQL mode). A new migration,
make_admin_audit_logs_morph_ids_strings, makesactor_id,subject_id
andimpersonator_idvarchar(64), keeping the data and the indexes; it
rolls back while every stored id is numeric. The ids are written as strings
(theMorphKeycast) and an integer key reads back as an int, as before.
AuditLog::forSubject()/forActor()andLoggable::auditLogs()compare
the key as a string, eager loading included (PostgreSQL has no
varchar = integer).audit/listandaudit/timelinedocument
subject_id/actor_idas strings. - The SPA's import did nothing but fail. The list's Import button sent
upload_id, readmappingandprocess_idand waited for statusdone,
whileimport/*takes and returnspath,auto_mapping,process.idand
completed: every import ended with the error toast. The flow now follows
the documented contract (composables/importFlow.ts), counts created and
updated rows, reports a failed import's own error and stops polling when
startalready returns a finished process. - The import's OpenAPI schemas described a different API.
ImportUploadPayloadandImportPreviewPayloadnow describe what
import/uploadandimport/previewreturn;ImportProcessPayload.process
references a newImportProcessschema. The unusedImportTargetField,
ImportPreviewRowandImportPreviewSummarywere removed.
Added
- The package's tests run on PostgreSQL or MySQL/MariaDB as well:
ADMIN_TEST_DB_DRIVER=pgsql|mysql|mariadbwithADMIN_TEST_DB_HOST,
_PORT,_DATABASE,_USERNAME,_PASSWORD.
v1.75.1 (security)
Security
- Import wrote into any resource, without permission checks (critical).
import/upload,import/previewandimport/startchecked only that the
resource was registered: any user signed in to the panel could create
records in any resource — read-only and create-denied ones included — and
the mapping could target any column of the model, written withforceFill
past the resource'sfillModel().previewandstartalso took the disk
from the request, so the first rows of any CSV/XLSX file on any disk could
be read by its path. Now every step requiresResource::importable()(still
falseby default) and the resource's{permission}.create, checked
through the user model'shasAccess()like the create action; columns map
onto the create form's fields only (422 invalid_mapping); a row is
validated and written through the same path as{slug}/create
(RecordWriter::create(): WYSIWYG sanitizing, translatable fields,
fillModel()), and the runner drops any stored mapping outside the form.
The disk isadmin.imports.diskonly (a different one —422 forbidden_disk); files go to a per-user folder under
admin.imports.directoryandpreview/startread only from the caller's
own folder (ImportUploads).import/statusanswers the owner of the
process or a holder of{permission}.create, anyone else a 404. uploads/servestreamed any file of a servable disk (high). With the
defaultservable_disks— the uploads disk — every panel user could read
every file on that disk by its path: private attachments, other users'
import files. A disk listed by name now servesadmin.uploads.directory
only; a disk given as a key serves the folders it lists, or all of it for
'*'. Paths with..or.segments, backslashes, a leading slash, a NUL
byte or a scheme are refused.- Impersonation left no trace and could lock the administrator in (high).
The start and the end were logged as twologinentries — of the target,
then of the administrator — and changes made meanwhile named only the
target. Nowimpersonation.started/impersonation.stoppedare written
(actor — the administrator, subject — the target), the switch is no longer
logged as a login, and every audit entry written during an impersonation —
by any code — carriesimpersonator_type/impersonator_id(new
migration).block_higher_poweredlet any target through whose model had
nogetAllPermissions()— which switched the check off for such hosts —
and compared wildcard keys literally; it now refuses a target it cannot
compare and asks the impersonator'shasAccess()for each of the target's
keys. A target who cannot use the panel or is switched off is refused
(422 target_cannot_sign_in); if the target loses access meanwhile, the
session is kept andauth/stopImpersonationstill works. Coming back does
not restore an administrator switched off or with a password changed since
the start. delayed/statusshowed any process's result to any panel user
(medium). It now answers the user who started the process through
delayed/run(remembered by uuid,admin.delayed.owner_ttl), holders of
the permissions the handler was allowlisted with, and holders of
admin.delayed.status_permission; anyone else gets a 404.
ProcessOwnership::remember()marks a process started by the host's code.- The panels' API documentation was public (medium).
/api/admin/doc
and laravel-api's/api/doc/{panel}served the full map of the back office
to anyone. Both now need a user signed in to the panel with
admin.api_docs.permission(admin.systems.api-docsby default) and are
off by default in production (admin.api_docs.enabled); laravel-api's
/api/docindex hides the panel versions from other readers
(AdminApiModule::getDocMiddleware()addsApiDocsAccess). The page reads
its specs from the guarded/api/admin/doc/specs/{version}.jsoninstead of
files written intopublic/openapi. - A password reset skipped 2FA (medium).
auth/resetPasswordsigned the
user in right away, so access to the mailbox was enough for an account with
2FA. Such a user is no longer signed in (payload.userisnull) and goes
through the login form and its code.
Changed
- Impersonation messages are in Russian, with English translations.
- See the migration guide for what a host has to check.
v1.75.0
- A fall that is good.
StatsOverviewWidget::lowerIsBetter()swaps the
trend's colours of the card added last — for failures or waiting time a fall
is green and a rise red; the arrow keeps its direction.
Added
- A share in percentage points.
StatsOverviewWidget::share()marks the
card added last as a share in per cent: its change against the previous
period is shown as «▼ 0,2 п.п.» rather than per cent of the value;
trend($delta, $direction, 'pp')sets such a trend explicitly. ListWidget(list) — rows without a table header: a caption, a
secondary text, a badge with its tone, a link per row, and an empty state
(item(),items(),emptyText()).- A progress column.
TableColumn::asProgress($max = 100, $decimals = 0, $tone = null)
draws a 0..max value as a bar captioned «42 %» — in a table widget, a recent
list, a resource list and an embedded table. - A cell's tone.
TableColumn::tone()— a tone for the whole column or a
function of the value and the row; it colours the cell's text, badge or
bar. The tones travel beside the row under__tones, the value is
untouched. A formatter may also return['value' => …, 'tone' => …]. - Links in a widget's header.
Widget::headerLink($label, $url, $key, $permission)
andheaderLinks([...])— «Full report», «Journal» right of the title, by
permission; a widget without a header shows them in its corner. - Compact numbers and a list in one card.
StatsOverviewWidget::compact()
puts the numbers in one row inside one card, without the 180 px minimum
width of a stat card; rows added withitem()follow under them in the same
card. - Tiles.
StatsOverviewWidget::tiles()— small bordered tiles: a caption,
the number large and its hint;hintTone()draws the hint as a toned badge
(in the default cards too). ActionsWidget(actions) — a row of buttons, the first one primary,
fromQuickCreateitems shown by the same permission rules as the top bar's
«+ Create»;fromQuickCreate()takes the panel's own items.
v1.74.2
Fixed
- Vertical tabs: the active marker scrolled away with a long name. The
kit leaves a tab list scrollable sideways; in a vertical column a name longer
than the column scrolled, and the marker on the tab's right edge moved with
the text. The column no longer scrolls sideways and long names wrap onto a
second line; a tab's counter never breaks and the counters stand at the
column's right edge.
v1.74.1
Added
- A recommended length.
->counter(60, soft: true)counts against 60
without capping the input; past it the hint says «— длиннее рекомендуемого».
For SEO titles and descriptions whose existing values are often longer.
Fixed
- The confirmation opened behind a record drawer. «Unsaved changes —
leave?» and the other questions ofuseConfirm()showed under the drawer
they were asked from, so nothing could be answered. The kit gives modals and
drawers one layer and teleports each where it was mounted; the panel-wide
dialog, mounted first, came out behind. It is now raised above drawers and
other modals.
v1.74.0
Added
- One look for empty, nothing found, failed and no access.
Resource::emptyState()andLayout::resourceIndex()->emptyState($title, $description, $action)
(Support\EmptyState; the action: null — "Create", a string — its caption,
anAction, false — none;->noResults()). "Nothing found" lists the
applied filters and offers "Reset the filters". A failed load shows the
reason, "Retry" and the request code with "Copy the code": the client puts
X-Request-Idon every request, the server echoes it and logs it as
admin_request_id. "No access" names the section and the missing key with
"Copy the key": the router passes them to the 403 page,AdminAccesssends
payload.permission. A screen that fails to load and the embedded table of
related records show the same states.AdminStateis exported. Field\PermissionMatrix— a role's permissions as a matrix: folding
groups with a three-state checkbox and "N of M", a search over labels,
hints and keys, "Only selected", "Select all", "Selected N of M", an
optional second column (extraColumn()). The value is a list of keys;
groups from an array, a closure orfromRegistry().- A list or a screen in a side panel by a link.
Link::inDrawer()/
target('drawer'),TableColumn::asLink($template, 'drawer'),
openInDrawer($url): a resource's list filtered, sorted and scoped by the
link's query (kept out of the page's address), or a screen with its query,
over the current page; "Open as a page". Layout::timeline()— events of different kinds with icon, tone,
time, title, folded details and a link; chips by kind with counts and
"Only errors"; from a state key, a list or a closure;limit().- Before / after in the audit history: long texts line by line (one long
line word by word), JSON aspath: valuelines, changes marked, unchanged
runs folded.AuditValueDiffis exported. Tabs::searchable()— a search over the fields of every tab: finds per
tab, dimmed tabs without any, the fields and blocks it does not find
hidden, the ones it does marked.- Unsaved changes.
Screen::saveMethod()— a sticky bar naming the
changed fields by tab and block, Discard and Save, a mark on each changed
field, a question before leaving. A resource form asks before leaving with
changes too. Field::counter(?max)— "27 of 120 characters" under a text field;
StatsOverviewWidget::stat(..., hint:)— a line under the number.
Changed
- An empty list reads "No records" (was "Nothing here yet"). See the
migration guide for the other visible changes.
Not in this release
- Rolling a value back from the audit log: the package has no restore from
the log; a project action does it. - A cross-resource trash, the top bar and widget odds and ends (a search
field in the top bar, the role under the user's name, title badges,
"1 of N" in the record drawer) and the page builder's additions.
v1.73.0
Added
- Menu counters computed per request.
MenuNode::badge(fn (?Model $user) => …, 'danger')
— the closure runs on every menu request for the signed-in user, only
when the node is visible to them, and may return a number, a text, null or
['value' => …, 'tone' => …]; one that throws shows nothing. A red tone
(danger),99+above 99.GET system/menuCountersreturns the computed
badges alone, and the panel polls it every
admin.navigation.poll_intervalseconds (60; 0 — off) and when the browser
tab becomes visible.MenuNode::sumBadges()(or
admin.navigation.sum_badges) — a folded group or area shows the sum of
its descendants' counters, red when one of them is. - Folded groups, remembered; titled sections.
MenuNode::collapsed()/
->expanded()set a group's initial state,admin.navigation.groups_expanded
the panel's default (folded, as before); the user's own folding is saved on
the server per user and comes with the menu (groups).
MenuNode::section('Pinned', [...])— a titled block of the root whose
items are listed flat; the breadcrumbs leave it out. - Favourites and recent pages. A star in the top bar keeps any page with
its query (a tab, a list's filters) in the user's favourites — a block above
the menu, reordered by dragging or Alt+↑/↓, at most
admin.navigation.favorites_limit(7). The lastrecent_limit(10) screens
and records opened are kept as well. Both live on the server — the new
package migrationadmin_navigation_states— behindnavigation/state,
favorite,unfavorite,reorderFavorites,visitandgroup, and are
shown only where the user's permissions let them in right now
(Navigation\UrlAccess). - The Ctrl+K palette. An empty query shows the favourites and the recent
pages; the sections include the tabs of the menu's screens kept in the
address (GET system/menuTabs), found by the label, the menu path and the
tab's key; the "+ Create" items are its actions.
$admin->searchProviders([SearchProvider::make($key, $label)->recognizes($regexOrClosure)->priority(…)->using(fn ($q, $user) => [...])])
— the host's own searches, withrecognizesPhone(),recognizesEmail(),
onlyWhenRecognized(),permission()andlimit(): a group whose
recognizer recognized the input goes on top.Support\Maskmasks the
items. - A list's condition and default filters, tab badges.
Resource::scopes()— named conditions — and
Layout::resourceIndex(X::class)->scope('pending'): every request of the
list carriesscope, which the user cannot lift (an unknown one is a 422);
->defaultFilters([...])— the filters a list opens with, which the user
may clear (filter=nonekeeps it cleared).Resource::countIn($scope).
Layout::tabs()->badges([key => number|closure|['value', 'tone']])/
->badge($key, $value, $tone). - "+ Create".
$admin->menu()->quickCreate([QuickCreate::resource(NewsResource::class), QuickCreate::make($key, $label, $url)->permission(…)])
— a menu in the top bar filtered by permission (.createfor a resource). Layout::screen(ScreenClass::class, $params)— another screen in
place, a tab say, with its own state, command bar, methods and
permissions (a store of its own in the SPA).- Dashboard periods.
DashboardContexttakestoday,month,
quarterand rangesY-m-d..Y-m-dbesidesNdandall, with
label()/labelFor(),previous(),compare()/comparing(),
filterQuery($field)andlistUrl($path, $field).
DashboardScreen::customRange()(a range picker) andcomparable()
("Compare with the previous period",dashboard/widgets?compare=1); the
manifest carriesperiodLabels.Widget::link($url)— a link on a widget;
StatsOverviewWidget::url()/stat(..., url: …)andprevious()— a link
and the previous value of each number. - Masked personal data.
TableColumn::masked('phone'|'email'|'name'|'passport'|'full'|Closure, ?$permission)
— the value leaves the server masked, in the export too; the cell's "Show"
callsPOST /{slug}/revealwith the permission ({base}.revealby
default), and the reveal is written to the audit log aspii.revealed
(actor, record, field). The list'smeta.revealablenames what the user may
reveal. - Breadcrumbs.
admin.navigation.breadcrumbs = 'compact'—
Area › Screen › Tab › Record without the menu's groups; the open tabs kept
in the address are named after the screen; a crumb of a list or a screen
leads back with the query it was left with.
Changed
- A list's address keeps a date range as
filter[x][from]/
filter[x][to](it used to be written as[object Object]) and reads it
back, so a widget can link "to the journal for the period". Layout::dashboard()on an ordinary screen leaves out the widgets whose
permission()the user lacks, as aDashboardScreendoes.dashboard/savePeriodanddashboard/widgetstake periods up to 32
characters.
Fixed
- Columns of a resource were read while the routes were being built.
Deciding whether a resource needs therevealendpoint called its
columns()from the route compiler — before the host's own routes exist, so
a column that builds a URL withroute()broke the whole panel API. The
endpoint is now registered for every resource; the controller already
refuses a column that is not masked (422 not_masked).
v1.72.0
Added
Layout::blockTree(): palette presets.->presets([BlockPreset::make($key, $label, $type)->data([...])->meta([...])])
(or->preset($key, $label, $type, $data, $meta, $group, $icon), or arrays
throughBlockPreset::fromArray) — a palette item that inserts a ready
node: of an ordinary type, with its own data, meta and, maybe, children
(->children([...])), in a group of the palette, with an icon, a
description and a thumbnail. A shared block of a library, say, no longer
needs a type of its own. The pick inserts a node of that type with a copy
of the data and meta under a new temporary ref (each child its own); the
preset is offered only where its type — and its children — may stand by
the type's rules andmeta.accepts, andTreeValidatorchecks the node as
any other. A preset of a type the editor does not have is not sent.BlockTree::draftSaved(..., nodes: [ref => ['data' => [...], 'meta' => [...]]])
— the draft's answer may give the data and meta of the nodes the server
normalized (a file's temporary path made permanent, a preset turned into a
full block), by the renamed ref (or the temporary one). The editor applies
them, except the fields typed in while the request was out: those keep the
input (and theirmeta.fieldsentry) and go with the next draft. The open
properties form is updated in place — the input keeps its focus.data-testidfor end-to-end tests. The shell and the pages are marked
by names and keys, never by captions: the login and two-factor forms, the
menu (menu-{key}on groups too), the user menu, the toasts
(toast-{level}), a resource's list (resource-index-{slug}, the search,
filter-{name}with its popover and buttons,resource-row-{key},
cell-{column}, the row and bulk actions, the pagination), the form
(field-{name},form-cancel), the card (entry-{name},view-*), the
screen (screen-{slug},screen-commands),Layout::modal()/
Layout::drawer(), the tabs (tab-{key}) and the block tree
(block-tree-node-{ref}, the palette's types and presets, the bar). The
names that were there stay.testIdOf(...parts)is exported for the
host's own components. The list is indocs/*/testing.md.
v1.71.0
Added
Layout::blockTree(): inherited fields. A node may carry
meta.fields—{name: {inherited, base}}— for a tree whose blocks
inherit from shared base blocks. The properties form marks such a field
Inherited (the value is the base's) or Overridden, with Return the
base value: it putsbaseinto the node's data (the node is changed, as
after an edit, and the step can be undone) and setsinheritedback to
true for the server. An edit of an inherited field turns the mark to
Overridden at once — the value is compared withbase; what is saved is
still the server's decision.Layout::blockTree(): node rules.meta.accepts— the types allowed
inside this node instead of its type's ([]— none);meta.locked— the
node is read-only: its form, its children (none added, removed or
reordered), its place and its removal; it can still be selected and
viewed, and is marked with a lock. The palette, the drag's drop zones, the
insert, duplicate and delete all follow them.TreeValidatorchecks
meta.accepts, and with the stored tree given —
errors($nodes, original: $stored), also onpasses()andvalidate()—
reads the meta from there (the request cannot widen the rules) and keeps a
locked node's type, data, parent and children; it may go away only with an
unlocked ancestor removed as a whole.BlockTree::draftSaved($refs, $fingerprint, ?$savedAt)— the draft's
answer that does not replace the tree: the new blocks' temporary refs are
renamed to their ids (['new-1a2b' => 51]) — with the selection, the
folded nodes, the open form and the undo steps — and the value takes the
new fingerprint. Whatever was typed while the request was out stays and
goes with the next draft.BlockTree::saved($value)works as before.
Fixed
Layout::blockTree(): a conflict and errors in the draft's answer.
BlockTree::conflict()andBlockTree::invalid()from the draft method —
and aValidationExceptionkeyed by the tree's path — were ignored or only
toasted. They are now shown as for the publish: the differences in a
message (Draft not saved), the nodes' errors on the nodes. The autosave
pauses meanwhile: after errors until the next change, after a conflict
until Save over in the bar (it takes the conflict's fingerprint and saves
again) or a publish, discard or reload.