laravelrus / sleepingowladmin Goto Github PK
View Code? Open in Web Editor NEW🦉 Administrative interface builder for Laravel (Laravel admin)
Home Page: http://sleepingowladmin.ru/
License: MIT License
🦉 Administrative interface builder for Laravel (Laravel admin)
Home Page: http://sleepingowladmin.ru/
License: MIT License
Сейчас используется шаблон админ панели http://startbootstrap.com/template-overviews/sb-admin-2/
Существует альтернативная админ панель https://almsaeedstudio.com/themes/AdminLTE/index2.html
Возможно стоит мигрировать пока не поздно?!
Is it possible to edit a relationship model with pivot?
Example:
$this->belongsToMany('App \ Role')->withPivot('column1', 'column2');
Like this but you can edit the columns.
AdminFormElement::multiselect()
FatalErrorException in DisplayTable.php line 97: Class 'SleepingOwl\Admin\TableColumn' not found
Hi, I am moving from sleeping-owl/admin to this package. I have a question, or a feature request, about the checkbox column. Is it possible to use it to show and modify a model attribute? For example in the demo there is the "news" model with a "published" attribute. In the display table (http://demo.sleepingowladmin.ru/admin/news/v5 ) this attribute is a custom column, I would like to use the checkbox column to show and change this field value. I am able to change the _published _value using the checkbox column and a custom display action, but with this approach when the table is loaded all the checkboxes are unchecked, they are not linked to a model attribute.
Thanks, Carlo
Необходимо дать возможность настраивать Policy для каждого раздела
Как правильно организовать в sleeping-owl, Multi-Language Content?
Я начинала это с помощью tabbed, для каждого языка отдельный таб.
есть tabel category_description для меняешься content и tabel prso_categories для поля которые не нужно переводить.
FormItem::text('description["name"][]', 'Category Name'),
description["..."][]
правильно такой подход?
как правильно связать эти два таблица?
и как его правильно реализовать в sleeping-owl?
Буду рад если кто-то сможет помочь.
I've got the same message but I downloaded a v4 version as indicated on the github site. Anyone has a solution ? Thanks
Hi all,
I was experimenting around with soft-deletable models and found the following issues:
$display->setApply(function(Builder $query) { $query->withTrashed(); });
, otherwise the soft deleted records won't be visible (in my opinion this should be enabled by default when the user is allowed to restore records and the model is soft-deletable (check on withTrashed/onlyTrashed as used in BaseRepository findMany))...$this->getQuery()
or $this->getModel()->query()
(I used the 2nd one, since the first one also includes relations in the query))...After these fixes soft-deleting works as expected...
I am using the old documentation for the new development branch. This is the error i get for the commands, did the commands change?(if they did do you have any docs of the new code) or ?
Awesome project btw guys :)
https://github.com/LaravelRUS/SleepingOwlAdmin/blob/development/src/Column/String.php#L5
Не заводится под PHP 7, т.к. String является зарезервированным словом. Нужно придумать вместо String какое-нибудь подходящее название
I have implemented the latest version of Sleeping Owl Admin. In my local environment it works perfectly. But on my server there are models that do not look at the menu, and you can not see when you click on an empty space. Is there a mod php or something you have to activate?
And the menu order is reversed. (If I put the "priority" works).
use sleeping-owl V3.
I want to add two more parameters to this function $catagory_id
, $lang_id
:
I added these two parameters to the function, which is in ModelConfiguration.php
.
public function fullEdit($id, $catagory_id, $lang_id)
{
$edit = $this->edit($id);
if ($edit instanceof FormInterface)
{
$edit->setAction($this->updateUrl($id));
$edit->setId($id);
}
return $edit;
}
function does not see
Error:
Missing argument 2 for SleepingOwl\Admin\Model\ModelConfiguration::fullEdit(), called in
can someone help me?
Hi there
I have a little question ATM i have a form working well but i need to save a slug for the slug value. But i cant fint how can i do that with this package and in a auto way.
AdminColumn::action does not have wrapper. New Action columns added to top of the table
I want to send another 2 parameters
use tabs
$description = Admin::model(Ecommerce\Productso\Models\CategoryDescription::class)->fullEdit($editId);
$description->parameters(['category_id' => $category_id, 'language_id' => $item->language_id]);
Error: Call to undefined method SleepingOwl\Admin\Form\FormDefault::parameters()
please help me.
Thanks.
Hello @butschster,
on a multi language site there's no a native way to manage contents on laravel.
One of this is to install dimsav/laravel-translatable that modify the model in a way where you can save translatable fields for each model, like:
//Filling multiple translations
$data = [
'code' => 'gr',
'en' => ['name' => 'Greece'],
'fr' => ['name' => 'Grèce'],
];
$greece = Country::create($data);
echo $greece->translate('fr')->name; // Grèce
Here an article: https://laravel-news.com/2015/09/how-to-add-multilingual-support-to-eloquent/
Here the lib: https://github.com/dimsav/laravel-translatable
The target is to build a CRUD with a form with all translation as described by #20.
I think it's not needed to build something "out of the box", but a sort of guide to implement it because in this way SleepingOwlAdmin become a full featured cms or sort of.
What I think to implement is sort of this (many crud works in this way):
http://screenpresso.com/=QBdBg
thank you!
Denis
$description = Admin::model(Ecommerce\Productso\Models\CategoryDescription::class)->fullEdit($editId);
$description->items([
FormItem::hidden('language_id')->defaultValue($id),
FormItem::hidden('language_id')->defaultValue($item->language_id)
]);
$tabs[] = AdminDisplay::tab($description)->label($item->name);
I want to add two fields in imported form
By default TableColumn
use SleepingOwl\Admin\Display\TableHeaderColumn
class for header.
But sometimes need to change to custom header class.
it would be great if we could do this:
// Created custom header class instanced of SleepingOwl\Admin\Contracts\Display\TableHeaderColumnInterface
$header = new App\Custom\TableHeader;
// Setting default class for all table headers
$header->setAttribute('class', 'bg-primary');
$table = AdminDisplay::table();
$table->setHeaderClass($header);
$table->setColumns([
...
AdminColumn::string()
...
]);
I also add two parameters {category_id?}/{lang_id?}
if instead this route. Error 404
Route::get('{adminModel}/{adminModelId}/{category_id?}/{lang_id?}/edit', [
'as' => 'admin.model.edit',
'uses' => 'AdminController@getEdit',
]);
can someone help me?
Hello,
in the previous version (v3) there was the configuration for manage static navigation menu, I mean adding for example Dashboard link to menu or a static page (with a static controller) in this way:
Admin::menu()->url('/')->label('Dashboard')->icon('fa-dashboard');
Admin::menu(\App\Models\Customer::class)->icon('fa-user')->label('Customers');
Admin::menu()->url('/stats')->label('Stats')->icon('fa-trello');
There's a way to manage it with the new configuration using navigation.php?
I only see that you can manage groups of pages, but not single page, eg:
[
'title' => 'Permissions',
'icon' => 'fa fa-group',
'pages' => [
(new Page(\App\User::class))
->setIcon('fa fa-user')
->setPriority(0),
(new Page(\App\Role::class))
->setIcon('fa fa-group')
->setPriority(100)
]
]
but, something like this is not working:
[
'title' => 'Permissions',
'icon' => 'fa fa-group',
'pages' =>
(new Page(null))
->setIcon('fa fa-user')
->setPriority(0),
-->setUrl("/stats")
]
Any suggestion?
bye!
Здравствуйте, возможно ли создать 2 админки (admin и user) - где админ имеет все права, а юсер - редактирует только всю информацию?
Sometimes, form has field (for example: password
), which should not update if empty.
Example
User model App\User
has field password
// Create And Edit
$model->onCreate(function() {
return AdminForm::panel()->addBody([
...
AdminFormElement::password('password', 'Password')->required()->addValidationRule('min:6'),
...
]);
});
$model->onEdit(function() {
return AdminForm::panel()->addBody([
...
AdminFormElement::password('password', 'Password')->updateIfFilled(), // or updateIfNotEmpty()
...
]);
});
Hi all,
I really like the look and feel of this admin package, I just have one problem. I'm trying to implement the column filters and it seems they are not working. They display fine, but it seems there is no way to actually apply the filter (no response when pressing enter, nor a search or apply button anywhere)...
It appears this is also the case on the demo site (http://demo.sleepingowladmin.ru/admin/contacts4)
Laravel: 5.2.*
SleepingOwl: ~4.17@dev
Browser: Chrome 49.0.2623.87
Probably the capability to search text in a column coming from a related table could be useful.
The solution in
sleeping-owl/admin#264
could be used.
Hello,
there's a way to set a specific controller that override the standard controller for a specific model?
I mean something like this:
// /app/Admin/Contact3.php
$model->onDisplay(function () {
$display = AdminDisplay::table();
...
$display->setController("/App/Http/Controller/MyCustomContact3Controller@list");
...
}
$model->onCreateAndEdit(function($id = null) {
$display = AdminDisplay::tabbed();
...
$display->setController("/App/Http/Controller/MyCustomContact3Controller@save");
}
I think it's very useful for making custom behaviour on list or save (IE: elaborate data before save or call background shell commands etc..).
The link to the docs for v4 is not working , also do you have a forum where i can follow the development process in english
Great project
http://joxi.ru/ZrJpP8Jf10EMZ2
кидает на этот адрес http://sleepingowladmindemo.cloudcontrolled.com/
http://joxi.ru/xAe5QzbcYaQRjA
вместо этого http://demo.sleepingowladmin.ru/admin
Chrome browser version 49.0.2623.87 m
I want to add two more parameters to this function $catagory_id, $lang_id:
I made changes
ModelConfiguration Function:
public function fullEdit($id, $catagory_id=null, $lang_id=null)
{
$edit = $this->edit($id);
if ($edit instanceof FormInterface)
{
$edit->setAction($this->updateUrl($id));
$edit->setId($id);
}
return $edit;
}
Route:
Route::get('{adminModel}/{adminModelId}/edit/{category_id?}/{lang_id?}', [
'as' => 'admin.model.edit',
'uses' => 'AdminController@getEdit',
]);
AdminController Function
public function getEdit($model, $id, $catagory_id=null, $lang_id=null)
{
$edit = $model->fullEdit($id);
if (is_null($edit)) {
abort(404);
}
return $this->render($model->title(), $edit);
}
and nothing, something escapes me.
error 404
help me please?
когда заходишь в admin NotFoundHttpException in RouteCollection.php line 161.
как это можно исправить?
Спасибо.
Hi,
I want to try and use this product, I have some questions if I may.
Thanks!
my env:
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"dingo/api": "1.0.x@dev",
"tymon/jwt-auth": "^0.5.9",
"laravelrus/sleepingowl": "4.*@dev"
After composer update , artisan route:list
---------------------------------------------+------------+
| Domain | Method | URI | Name | Action | Middleware |
+--------+----------+----------------------------------------------+--------------------------------------+------------------------------------------------------------------+------------+
| | GET|HEAD | / | | Closure | |
| | GET|HEAD | admin | admin.dashboard | Closure | web,auth |
| | POST | admin/FormElements/image/uploadFile | admin.form.element.image.uploadFile | Closure | web,auth |
| | POST | admin/FormElements/image/uploadImage | admin.form.element.image.uploadImage | Closure | web,auth |
| | GET|HEAD | admin/assets/admin.scripts | admin.scripts | SleepingOwl\Admin\Http\Controllers\AdminController@getScripts | web,auth |
| | GET|HEAD | admin/assets/images/all | | Closure | web,auth |
| | POST | admin/assets/images/upload | | Closure | web,auth |
| | GET|HEAD | admin/information | admin.information | Closure | web,auth |
| | GET|HEAD | admin/{adminModel} | admin.model | SleepingOwl\Admin\Http\Controllers\AdminController@getDisplay | web,auth |
| | GET|HEAD | admin/{adminModel}/async/{adminDisplayName?} | admin.model.async | Closure | web,auth |
| | GET|HEAD | admin/{adminModel}/create | admin.model.create | SleepingOwl\Admin\Http\Controllers\AdminController@getCreate | web,auth |
| | POST | admin/{adminModel}/create | admin.model.store | SleepingOwl\Admin\Http\Controllers\AdminController@postStore | web,auth |
| | POST | admin/{adminModel}/reorder | | Closure | web,auth |
| | DELETE | admin/{adminModel}/{adminModelId}/delete | admin.model.destroy | SleepingOwl\Admin\Http\Controllers\AdminController@deleteDestroy | web,auth |
| | POST | admin/{adminModel}/{adminModelId}/down | admin.model.move-down | Closure | web,auth |
| | POST | admin/{adminModel}/{adminModelId}/edit | admin.model.update | SleepingOwl\Admin\Http\Controllers\AdminController@postUpdate | web,auth |
| | GET|HEAD | admin/{adminModel}/{adminModelId}/edit | admin.model.edit | SleepingOwl\Admin\Http\Controllers\AdminController@getEdit | web,auth |
| | POST | admin/{adminModel}/{adminModelId}/restore | admin.model.restore | SleepingOwl\Admin\Http\Controllers\AdminController@postRestore | web,auth |
| | POST | admin/{adminModel}/{adminModelId}/up | admin.model.move-up | Closure | web,auth |
| | GET|HEAD | admin/{adminWildcard} | admin.wildcard | SleepingOwl\Admin\Http\Controllers\AdminController@getWildcard | web,auth |
+--------+----------+----------------------------------------------+--------------------------------------+------------------------------------------------------------------+------------+
when i visit: http://xx/admin , then it jump to http://xx/login and say
Sorry, the page you are looking for could not be found.
what's wrong ?
Добавить возможность изменять текст кнопок для форм
$display->setColumns(
AdminColumn::link('blablabla')->setLabel('aaa')->setLinkAttributes(['href' => 'blablabla'])
);
does not work, because setLinkAttributes is void
Hello.
i created some Custom Form (and Column) Elements.
When i run this at localhost everything is fine.
Problem is when i upload this. I cant get those Classes running.
I Know i should use those files outside /vendor but i cant understand the logic on those errors so im using all files inside the default FormItem and Column, @vendor/sleeping-owl
2 questions:
how can i use those custom files, per example, inside /app/admin;
at this moment i have this Custom Form Element:
<?php
namespace SleepingOwl\Admin\Models\Form\FormItem;
use SleepingOwl\Admin\Models\Form\Interfaces\FormItemInterface;
use SleepingOwl\Admin\Models\Form\FormItem\BaseFormItem;
use \Admin;
class FixedHidden extends BaseFormItem implements FormItemInterface
{
protected $label;
public function render()
{
$instance = Admin::instance()->formBuilder->getModel();
if ($instance->exists)
{
return $this->formBuilder->hidden($this->name, $this->getValueFromForm(), $this->attributes);
} else
{
return $this->formBuilder->hidden($this->name, $this->label, $this->attributes);
}
}
}
and @ app/admin/bootstrap.php:
FormItem::register('FixedHidden', 'SleepingOwl\Admin\Models\Form\FormItem\FixedHidden');
LOCALHOST is ok. online i get this error:
Class 'SleepingOwl\Admin\Models\Form\FormItem\Fixedhidden' not found
How can i fix this ?
_ Laravel 4.2
_ Admin V2
Thanks,
Мне кажется будет лучше использовать vue.js и semantic-ui
Is there any documentation?
https://github.com/LaravelRUS/SleepingOwlAdmin documentation links to http://sleeping-owl.github.io/v4 but doesn't work; 404
http://sleeping-owl.github.io/ takes me to http://sleeping-owl.github.io/en/Getting_Started/Installation.html => V2 docs
Which links to: https://github.com/sleeping-owl/admin (old repo)
Default examples in product for users model don't work out of the box. are they supposed to?
Some documentation would be great
The link for the documentation doesn't works.
Клиентам часто требуется быстрое клонирование/копирование записей внутри одной модели с изменением нескольких значений.
Maybe method setOrderable
should be renamed to setSortable
or disableSorting
Сейчас не показывается кнопка удаления записи, хотя причин для этого нет
hello.
another issue: i cant use /admin
when i try to access /admin (remote) i get a 404 error...
any idea why is this happening?
I have problem with English language and i need help with correcting readme.md
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.