1. Go to this page and download the library: Download codeartlv/joona library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
codeartlv / joona example snippets
namespace App\Providers;
use Codeart\Joona\MetaData\Locale;
use Codeart\Joona\MetaData\Page;
use Codeart\Joona\Panel;
use Codeart\Joona\Providers\JoonaPanelProvider;
class JoonaServiceProvider extends JoonaPanelProvider
{
protected function configure(Panel $panel): void
{
$panel
->setBasePath('/admin') // optional, default is /admin
->setLocales([
new Locale('English', 'en', 'us'),
])
->addViteResources([
'resources/scss/admin.scss',
'resources/js/admin.js',
])
->addPages([
Page::make('blog')
->route('blog.index')
->caption('Blog')
->icon('article'),
]);
}
}
use Codeart\Joona\MetaData\Page;
Page::make('settings.blog') // nested ID: settings → blog
->route('blog.index')
->caption('Blog posts')
->icon('article')
->badge(3) // int or callable
->activeRoutes(['blog.edit', 'blog.create']);
use Codeart\Joona\MetaData\Locale;
new Locale('Latviešu', 'lv', 'lv'); // caption, locale code, flag file key
$panel->addRoutes('secure', function () {
Route::get('/blog', [BlogController::class, 'index'])->name('blog.index');
});
$panel->addRoutes('free', function () {
Route::get('/public-report', [ReportController::class, 'show'])->name('report.public');
});