Releases: LaravelRUS/SleepingOwlAdmin
Releases · LaravelRUS/SleepingOwlAdmin
4.14.64-beta: Added Navigation Badge class to append badge to page
- Added Navigation Badge class to append badge to page
Example
(new Page(\App\Model\Contact2::class))
->setIcon('fa fa-fax')
->setPriority(100)
->addBadge(23, function($badge) {
$badge->setAttribute('class', 'bg-green');
});
or custom badge class
(new Page(\App\Model\Contact2::class))
->setIcon('fa fa-fax')
->setPriority(100)
->setBadge(new CustomBadge);
- Added HtmlAttributes in Navigation page class
Examle
(new Page(\App\Model\Contact2::class))->setAttribute('class', 'test-class');
4.13.64-beta
- Added navigation checking access rights
You can set global access rights rules
AdminNavigation::setAccessLogic(function(Page $page) {
return auth()->user()->isSuperAdmin();
});
or by section
AdminNavigation::addPage(...)->setAccessLogic(...)->setPages(function(Page $page) {
});
or by page
AdminNavigation::addPage(...)->setAccessLogic(...)->seturl(...);
- Nagigation can be build from array
app/Admin/navigation.php
AdminNavigation::setAccessLogic(function(Page $page) {
return auth()->user()->isSuperAdmin();
});
AdminNavigation::addPage(\App\User::class)->setTitle('test')->setPages(function(Page $page) {
$page
->addPage()
->setTitle('Dashboard')
->setUrl(route('admin.dashboard'))
->setPriority(100);
$page->addPage(\App\User::class);
});
return [
[
'title' => 'Dashboard',
'icon' => 'fa fa-dashboard',
'url' => route('admin.dashboard'),
],
[
'title' => 'Information',
'icon' => 'fa fa-exclamation-circle',
'url' => route('admin.information'),
],
[
'title' => 'Content',
'pages' => [
\App\User::class,
(new Page(\App\User::class))
->setPriority(100)
->setIcon('fa fa-user')
->setUrl('users')
->setAccessLogic(function (Page $page) {
return auth()->user()->isSuperAdmin();
}),
new Page([
'title' => 'News',
'priority' => 200,
'model' => \App\News::class
]),
(new Page(/* ... */))->setPages(function (Page $page) {
$page->addPage([
'title' => 'Blog',
'priority' => 100,
'model' => \App\Blog::class
));
$page->addPage(\App\Blog::class);
}),
[
'title' => 'News',
'priority' => 300,
'accessLogic' => function ($page) {
return $page->isActive();
},
'pages' => [
// ...
]
]
]
]
];
- Fixed routes
- Renamed BaseDateTime to DateTime
4.12.60-beta: Added Navigation class.
- Added Navigation class
- Removed composer package
kodicms/laravel-navigation
Example
AdminSection::addMenuPage(\App\Model\News::class)->setItems(function() {
AdminSection::addMenuPage()->setTitle('test')->setUrl('user/profile');
});
4.12.57-beta
- Fixed problem with create new record when used
FormElement::multiselect
- Added new parameter to setting menu item priority
4.12.55-beta
- Added new table column
AdminColumn::relatedLink
to show link to related section - Added
AdminColumn::email
table column view template - Fixed access checking for
AdminColumn::link
table column - Fixed problem with validation before creating
- Fixed filter column template styles
- Fixed content title.
4.12.48-beta
- Renamed Template class method
TemplateDefault::getTemplateViewPath
->TemplateDefault::getViewPath
- Added Template class method
TemplateDefault::makeTitle
- Added config
logo
key and renamedtitle_mini
->logo_mini
4.12.45-beta
- Added belongsTo and hasOne relations support in forms.
AdminFormElement::text('country.title', 'Country title')->required()
- Added validation labels
- Added new class
FormButtons
$form = AdminForm::panel();
$form->getButtons()
->setSaveButtonText('Save news')
->hideSaveAndCloseButton();
// or set custom buttons
$form->setButtons(new \App\Form\Buttons);
- Added class alias prefix in config file
- Added success message for creating, updating, deleting and restoring record.
$model->setMessageOnDelete('<i class="fa fa-comment-o fa-lg"></i> Contact deleted');
$model->setMessageOnCreate('<i class="fa fa-check fa-lg"></i> Contact created');
$model->setMessageOnUpdate('<i class="fa fa-check fa-lg"></i> Contact updated');
$model->setMessageOnRestore('<i class="fa fa-check fa-lg"></i> Contact restored');
By default uses messages from lang file.
- AdminDisplay moved to src directory and renamed to Display
- Remove getParams method. Use
toArray()
- Move Filter directory to Display
4.10.41-beta
- Fixed routes priority bug
4.10.40-beta
- Add more flexibility for table header column and table control column
Header column customization
$display->setColumns([
...
$fullNameColumn = AdminColumn::link('fullName')->setLabel('Name'),
...
]);
$fullNameColumn->getHeader()->setAttribute('class', 'bg-primary')->setTitle('Full name');
Control column customization
$display = AdminDisplay::table();
$display->getControlColumn()->getHeader()->setTitle('Control')->setAttribute('class', 'bg-black');
// or
$display->setControlColumn(new AdminColumn::customControl(...));
- Fixed styles for table control buttons
- Fixed form panel elements initialization
- Fixed tabbed display rendering
- Removed unused media library from common.less
- Form buttons grouped and moved to the dropdown menu.
4.9.35-beta: Добавлена проверка прав доступа на работу с разделом.
Добавлена проверка прав доступа на работу с разделом.
По умолчанию проверка прав отключена и доступ к разделам можно отключать посредством методов
$model->disableDisplay();
$model->disableCreating();
$model->disableEditing();
$model->disableDeleting();
$model->disableRestoring();
Также можно включить проверку прав с помощью Policies
Для этого необходимо включить ее
$model->enableAccessCheck();
После чего создать для модели Policy класс для модели, которая используется в текущем разделе https://laravel.com/docs/5.2/authorization#policies
И в класс Policy добавить методы
public function display(User $user, Model $model);
public function create(User $user, Model $model);
public function edit(User $user, Model $model);
public function restore(User $user, Model $model);
public function delete(User $user, Model $model);
После чего проверка прав будет дополнительно осуществляться на его основе