Shortcuts are the basic building blocks of the control panel topbar.
You can manually create a JSON file with the below attributes in the shortcuts directory.
You can create a new cp.shortcuts
entry using streams-cli.
php artisan entries:create cp.shortcuts
// // streams/cp/shortcuts/{id}.json
{
"image": "/auth/avatar",
"icon": "far-user-circle",
"svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">
<path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z\" />
</svg>",
"dropdown": {
"profile": {
"text": "Visit Website",
"href": "/",
"target": "_blank"
},
"logout": {
"text": "Logout",
"href": "/logout",
"target": "_blank"
}
}
}
slug
The unique handle of the shortcut.
string
Any valid image source.
string
Any valid icon identifier.
string
An SVG content string.
array
An associative array of dropdown menu items indexed by handle.