Download the PHP package codeartlv/joona without Composer
On this page you can find all versions of the php package codeartlv/joona. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download codeartlv/joona
More information about codeartlv/joona
Files in codeartlv/joona
Package joona
Short Description A simple backend template for Laravel projects
License MIT
Informations about the package joona
Joona
Joona is a Laravel admin panel package with user management, roles and permissions, activity logging, and a Bootstrap 5–based UI layer. Unlike opinionated admin builders, it does not force predefined CRUD screens—you build your own Blade views and routes while reusing layouts, form helpers, and JavaScript components.
Requirements
- PHP 8.2+
- Laravel 11.x (recommended for new projects; the package can be added to existing apps)
- Node.js and npm (for compiling your Vite assets)
- Composer
The package ships database migrations. If your application already has tables with the same names (admin_users, roles, etc.), resolve naming conflicts before migrating.
Installation
1. Install the package
Laravel auto-discovers Codeart\Joona\Providers\JoonaProvider, which registers migrations and Artisan commands.
2. Publish assets and application provider
This command:
- Runs
npm installinside the package asset directory (vendor/codeartlv/joona/resources/assets) - Publishes flag images to
public/vendor/joona - Publishes
config/joona.php - Publishes
app/Providers/JoonaServiceProvider.php(extendsJoonaPanelProvider) - Registers
JoonaServiceProviderinbootstrap/providers.php(Laravel 11+)
On Laravel 10 and below, add App\Providers\JoonaServiceProvider::class to config/app.php manually if it was not added automatically.
3. Run migrations and seed
Default login (change immediately in production):
| Field | Value |
|---|---|
| URL | /admin |
admin@localhost |
|
| Password | password |
The seeded password satisfies the default policy in config/joona.php (min:8,max:20,mixed,number,special). Stricter rules apply when users change passwords through the UI.
Frontend setup (Vite)
Joona does not ship pre-built CSS/JS for your app. You compile your own entry files and point the panel at them via addViteResources().
SCSS entry
Create e.g. resources/scss/admin.scss:
JavaScript entry
Create e.g. resources/js/admin.js:
main.js exports the runtime singleton as window.Joona. Call Joona.ready() once to bind data-bind handlers, load translations, and initialize built-in components.
Vite configuration
Run npm install in your Laravel project, then build:
Register Vite entries in the panel
Edit app/Providers/JoonaServiceProvider.php:
Layouts load these files with @vite($vite_resources) in resources/views/global.blade.php.
Custom <head> / body snippets
Publish or create:
resources/views/vendor/joona/head.blade.phpresources/views/vendor/joona/body.blade.php
They are included from the main layout automatically.
Panel configuration
Configure the panel in JoonaServiceProvider::configure() using the Panel instance:
| Method | Description |
|---|---|
setBasePath(string $path) |
URL prefix for the admin area (default /admin) |
setBaseDomain(string $domain) |
Optional dedicated domain |
setAppName(string $name) |
Title shown in the UI |
setLogo(string $light, ?string $dark, ?string $icon) |
Logo URLs |
setLocales(Locale[] $locales) |
Language switcher entries |
useRolesAndPermissions(bool $state) |
Enable/disable RBAC (default true) |
addViteResources(array $paths) |
Vite entry files |
addPages(Page[] $pages) |
Sidebar navigation |
addPermissions(array $groups) |
Custom permission groups |
setPermissionLoader(string $class) |
Custom permission loader class |
addUserClasses(array $levels) |
Extra user level enums/classes |
addNotifications(array $classes) |
Notification handler classes |
addRoutes('free' \| 'secure', callable\|string $routes) |
Register route files or closures |
Navigation pages
Top-level IDs appear in the sidebar; dotted IDs nest under the first segment.
Locales
Flag SVGs are served from public/vendor/joona/images/flags/{map}.svg.
Authentication and guards
Joona merges an admin guard and joona user provider into config/auth.php:
- Guard:
admin(session driver) - Provider model:
Codeart\Joona\Models\User\AdminUser - Facade helper:
joona.authresolvesAuth::guard('admin')
Use Auth::guard('admin') or the joona.auth binding in your code. Do not confuse this with Laravel’s default web guard.
Routes and middleware
Package routes are registered under Panel::getBasePath() with the web and admin.web middleware groups. Authenticated package routes also use admin.auth.
| Middleware group | Purpose |
|---|---|
admin.web |
Locale, theme, activity logging |
admin.auth |
Requires admin login; optional permission checks |
userclass |
Alias for CheckUserClass middleware |
Adding your own admin routes
Register routes in JoonaServiceProvider::configure():
Or pass a route file path:
secure— wrapped inadmin.auth(must be logged in).free— onlyweb+admin.web(e.g. login pages you add yourself).
Equivalent manual grouping:
Named routes are available in JavaScript via Ziggy (@routes in the layout). Use the global route() helper the same way as in PHP.
Views and layouts
Page layout (<x-content>)
The content component renders a page title, optional sidebar, header controls, main area, and footer:
- With a
sidebarslot, the sidebar layout is used. - Without it, the simple full-width layout is used.
Extending package layouts directly
Other layouts: joona::global, joona::simple, joona::sidebar.
Blade directives
| Directive | Output |
|---|---|
@icon('name') |
Material Symbols icon <i> |
@attributes([...]) |
Renders HTML attributes via HtmlHelper::attributes() |
Blade components
Components are registered without a namespace prefix—use <x-form>, <x-button>, etc.
Forms
The form renders data-bind="components.form" and submits via AJAX. Show feedback in an element with data-role="form.response" (created automatically if missing).
Field-level errors: use data-field="field_name" on a container, or rely on name matching inputs. Use * as the field key for global errors.
FormResponse (controller)
JSON shape: status (success|error), fields, message, actions, data.
Supported actions: redirect, reload, reset, close_popup, close_popup_reload.
Buttons
role maps to Bootstrap btn-{role}. Additional attributes are merged onto the <button> (default type="submit").
Alerts
Roles follow Bootstrap alert variants (info, success, danger, etc.).
Dialog (modal content)
Use inside a modal loaded by the JS Modal class or as inline modal markup:
Paginator
| Prop | Default | Description |
|---|---|---|
total |
0 |
Total row count |
size |
25 |
Rows per page |
param |
page |
Query string parameter |
range |
3 |
Page numbers shown around current |
links |
[] |
Custom link attributes; href can use sprintf with page number |
Hidden when only one page exists.
Input, textarea, select, checkbox
<x-select> options are Codeart\Joona\View\Components\Select\Option instances or Group objects for optgroups.
Datepicker, color picker, range
Pass extra data-* attributes for JS options (see component templates).
Password validator
Autocomplete
data-route is required (converted to route in JS). Optional: data-proxy, data-input.
Multiselect
Tags (Tagify)
Uploader
Preload files using Codeart\Joona\View\Components\Uploader\File\Image or Document (extend UploadedFile). Return UploadResponse from upload/delete endpoints.
Optional: data-croproute, data-sortable, data-captions, crop presets via [data-role="crop-presets"] JSON.
Gallery
Items should expose id, url, thumbnail for the template.
Editor (Editor.js)
Text editor (Pell)
Data table
Enables SortableJS when sortable is set (e.g. handle for drag handle selector).
Tree editor
Rows implement TreeNode (id, parentId, title, etc.).
Chart
$chartConfig is passed to Chart.js as JSON in the template.
Map picker
Other components
| Component | Usage |
|---|---|
<x-accordion> |
Collapsible sections |
<x-offcanvas> |
Offcanvas panel (header/body/footer slots) |
<x-navbar> |
Tab-like nav |
<x-container> |
Width-constrained wrapper |
<x-copy> |
Copy-to-clipboard control |
<x-dropdown-radio> |
Radio options in a dropdown |
<x-table-bulk-options> |
Bulk actions for tables |
<x-page-footer-bar> |
Sticky footer actions |
<x-form-section-heading> |
Section title in long forms |
<x-checkbox-group> |
Grouped checkboxes |
<x-toast> |
Toast markup (usually driven by JS) |
JavaScript API
Runtime (Joona)
Translations: trans('joona::common.ok') and choice() after ready() (backed by lang.js).
Modal
While open, window.JoonaModalInstance references the active modal.
Confirm dialog
Closes automatically when a button is pressed.
Custom JS handlers
Handlers group DOM behavior behind data-bind="plugin.action" attributes.
1. Create a handler class
edit-form in HTML maps to the editForm method.
2. Register and bind
3. Return instances for cross-component access
Return a plain object or a Promise from handler methods to store retrievable instances.
Built-in components handler
These data-bind values are handled automatically:
| Bind | Component |
|---|---|
components.form |
AJAX form |
components.uploader |
File uploader |
components.autocomplete |
Autocomplete |
components.datepicker |
Date picker |
components.multi-select |
Multiselect dropdown |
components.passwordValidator |
Password strength |
components.map-picker |
Leaflet map |
components.gallery |
Image gallery |
components.chart |
Chart.js |
components.tree-editor |
Nested sortable tree |
components.editor |
Editor.js |
components.text-editor |
Pell editor |
components.table |
Sortable table |
components.tags |
Tagify |
components.copy-text |
Clipboard copy |
components.table-bulk-options |
Bulk table actions |
The admin handler covers panel UI (theme switch, sidebar, notifications, profile modal, etc.).
Permissions
When useRolesAndPermissions(true):
- Routes can be tied to permissions via
RoutePermissioninsidePermissionGroupobjects. - Menu items hide automatically when
Gate::denies()the page route. - Middleware
CheckPermissionsruns onadmin.authroutes.
Register custom permissions in configure():
Configuration (config/joona.php)
| Key | Description |
|---|---|
admin_password_policy |
Comma-separated rules: min, max, uppercase, lowercase, mixed, number, special |
js_translations |
Extra translation keys exposed to JavaScript |
auto_block_user |
Failed login attempts before lockout (0 = disabled) |
class_role_mode |
interchangeable — user class vs role behavior |
Artisan commands
| Command | Description |
|---|---|
joona:publish |
Install npm deps in package assets, publish config/images/provider |
joona:seed |
Seed default admin user (AdminUserSeeder) |
joona:update-session |
Updates admin session records (scheduled every 10 minutes) |
Package structure (reference)
Notes
- The package adds an
adminguard andjoonaprovider—plan naming if you add more guards. - Static images (logos, flags) live under
public/vendor/joonaafter publish. - For HTMX projects, the runtime re-initializes bindings on
htmx:afterSwap/htmx:oobAfterSwapwhen HTMX is loaded in your app (not bundled with Joona). - Override package views by placing files in
resources/views/vendor/joona/.