Coder Social home page Coder Social logo

laravelrus / sleepingowladmin Goto Github PK

View Code? Open in Web Editor NEW
793.0 45.0 214.0 51.62 MB

πŸ¦‰ Administrative interface builder for Laravel (Laravel admin)

Home Page: http://sleepingowladmin.ru/

License: MIT License

JavaScript 11.03% CSS 1.61% PHP 75.52% HTML 0.69% SCSS 4.04% Blade 7.11%
laravel composer admin crud package backend laravel-admin laravel-crud

sleepingowladmin's Introduction

bg

Laravel Admin Panel SleepingOwl

Build Status StyleCI Laravel Support PHP Support

Official Site Demo Site Telegram Chat Latest Stable Version Total Downloads License

SleepingOwl Admin is an administrative interface builder for Laravel. Completely free

Support

  • Laravel > 5.5 - 5.8 (PHP < 7.1.3)
  • Laravel 6.* (PHP >= 7.2)
  • Laravel 7.* (PHP >= 7.2.5)
  • Laravel 8.* (PHP >= 7.3)
  • Laravel 9.* (PHP >= 8.0)
  • Laravel 10.* (PHP >= 8.1)

Lumen is NOT supported(((

Documentation new ver.9

Powered by Laravel 5.5 - 10+. (latest tested version 10.48.2)

Install ver 8.* (last Released)

Install SleepingOwl Admin

composer require laravelrus/sleepingowl:8.*

Install ver 7.*

  1. Install SleepingOwl Admin

composer require laravelrus/sleepingowl:7.*

or

If you upgrade the old version change in composer.json

"laravelrus/sleepingowl": "^7.*"

after run composer update laravelrus/sleepingowl

and run php artisan sleepingowl:update for update assets

  1. Run this command in the terminal (if you want to know more about what exactly this command does, see install command documentation):
php artisan sleepingowl:install

Authentication

  1. By default, admin module uses Laravel authentication.

If you want to use auth, you can run artisan command php artisan make:auth (https://laravel.com/docs/authentication) and append middleware auth to config/sleeping_owl.php

...
'middleware' => ['web', 'auth']
...
  1. Setting up middleware

By default auth middleware use default guard, selected in config/auth.php

'defaults' => [
  'guard' => 'web', <- default
  ...
],
  1. If you are using some package for ACL like (Laratrust, Zizaco Entrust, etc...)
'middleware' => ['web', 'role:admin'],

or

'middleware' => ['web', 'permission:admin'],

Copyright and License

Admin was written by Sleeping Owl for the Laravel framework and is released under the MIT License. See the LICENSE file for details.

sleepingowladmin's People

Contributors

aglok avatar alexdanielyan avatar alexrosenfeld avatar asvae avatar atmden avatar butochnikov avatar butschster avatar chancezeus avatar chrisnew avatar daaner avatar davidnadejdin avatar dependabot[bot] avatar everestmx avatar falur avatar heiswald avatar isrkar avatar lunatig avatar malezha avatar mediaceh avatar moisespsena avatar osbre avatar sleeping-owl avatar sngrl avatar spamarmy avatar stylecibot avatar theardent avatar unquaiz avatar vaiil avatar vladislavtkachenko avatar xcaptain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sleepingowladmin's Issues

Как ΠΏΡ€Π°Π²ΠΈΠ»ΡŒΠ½ΠΎ ΠΎΡ€Π³Π°Π½ΠΈΠ·ΠΎΠ²Π°Ρ‚ΡŒ Π² sleeping-owl Multi-Language

Как ΠΏΡ€Π°Π²ΠΈΠ»ΡŒΠ½ΠΎ ΠΎΡ€Π³Π°Π½ΠΈΠ·ΠΎΠ²Π°Ρ‚ΡŒ Π² sleeping-owl, Multi-Language Content?
Π― Π½Π°Ρ‡ΠΈΠ½Π°Π»Π° это с ΠΏΠΎΠΌΠΎΡ‰ΡŒΡŽ tabbed, для ΠΊΠ°ΠΆΠ΄ΠΎΠ³ΠΎ языка ΠΎΡ‚Π΄Π΅Π»ΡŒΠ½Ρ‹ΠΉ Ρ‚Π°Π±.

my project

Π΅ΡΡ‚ΡŒ tabel category_description для мСняСшься content ΠΈ tabel prso_categories для поля ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ Π½Π΅ Π½ΡƒΠΆΠ½ΠΎ ΠΏΠ΅Ρ€Π΅Π²ΠΎΠ΄ΠΈΡ‚ΡŒ.
FormItem::text('description["name"][]', 'Category Name'),
description["..."][]
ΠΏΡ€Π°Π²ΠΈΠ»ΡŒΠ½ΠΎ Ρ‚Π°ΠΊΠΎΠΉ ΠΏΠΎΠ΄Ρ…ΠΎΠ΄?
ΠΊΠ°ΠΊ ΠΏΡ€Π°Π²ΠΈΠ»ΡŒΠ½ΠΎ ΡΠ²ΡΠ·Π°Ρ‚ΡŒ эти Π΄Π²Π° Ρ‚Π°Π±Π»ΠΈΡ†Π°?
ΠΈ ΠΊΠ°ΠΊ Π΅Π³ΠΎ ΠΏΡ€Π°Π²ΠΈΠ»ΡŒΠ½ΠΎ Ρ€Π΅Π°Π»ΠΈΠ·ΠΎΠ²Π°Ρ‚ΡŒ Π² sleeping-owl?

Π‘ΡƒΠ΄Ρƒ Ρ€Π°Π΄ Ссли ΠΊΡ‚ΠΎ-Ρ‚ΠΎ смоТСт ΠΏΠΎΠΌΠΎΡ‡ΡŒ.

Checkbox column

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

navigation.php and single pages (without a model)

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!

Command not available in the "admin" namespace

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 :)

push two items in form please help me

$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

Routes SleepingOwlAdmin

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?

Policies

НСобходимо Π΄Π°Ρ‚ΡŒ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡ‚ΡŒ Π½Π°ΡΡ‚Ρ€Π°ΠΈΠ²Π°Ρ‚ΡŒ Policy для ΠΊΠ°ΠΆΠ΄ΠΎΠ³ΠΎ Ρ€Π°Π·Π΄Π΅Π»Π°

Feature Request: Vue.js

МнС каТСтся Π±ΡƒΠ΄Π΅Ρ‚ Π»ΡƒΡ‡ΡˆΠ΅ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ vue.js ΠΈ semantic-ui

function fullEdit()

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?

Π—Π°ΠΌΠ΅Π½Π° sb-admin2 Π½Π° adminlte

БСйчас ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠ΅Ρ‚ΡΡ шаблон Π°Π΄ΠΌΠΈΠ½ ΠΏΠ°Π½Π΅Π»ΠΈ http://startbootstrap.com/template-overviews/sb-admin-2/
БущСствуСт Π°Π»ΡŒΡ‚Π΅Ρ€Π½Π°Ρ‚ΠΈΠ²Π½Π°Ρ Π°Π΄ΠΌΠΈΠ½ панСль https://almsaeedstudio.com/themes/AdminLTE/index2.html

Π’ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎ стоит ΠΌΠΈΠ³Ρ€ΠΈΡ€ΠΎΠ²Π°Ρ‚ΡŒ ΠΏΠΎΠΊΠ° Π½Π΅ ΠΏΠΎΠ·Π΄Π½ΠΎ?!

Link to V4 documentation not woking

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

function fullEdit()

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?

Manage Multi-Language contents on CRUD

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

V2 :: ROUTE - public_html/admin

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?

Set Parameters SleepingOwl

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.

Restore not working

Hi all,

I was experimenting around with soft-deletable models and found the following issues:

  1. You have to manually add $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))...
  2. In AdminController the postRestore function does a find on the model, but the find method in the repository doesn't include trashed records, so it always returns false (I fixed it by copying findMany and instead of whereIn use find)...
  3. In BaseRepository the restore function calls $this->query() which doesn't exist (you either have to call $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...

NotFoundHttpException in RouteCollection.php line 161:

ΠΊΠΎΠ³Π΄Π° Π·Π°Ρ…ΠΎΠ΄ΠΈΡˆΡŒ Π² admin NotFoundHttpException in RouteCollection.php line 161.
ΠΊΠ°ΠΊ это ΠΌΠΎΠΆΠ½ΠΎ ΠΈΡΠΏΡ€Π°Π²ΠΈΡ‚ΡŒ?

Бпасибо.

route wrong redirect .

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 ?

Model works in local, but not in server

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).

My Local
local

My Server
server

Generate slug from Form

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.

two admin panel with different user role

ЗдравствуйтС, Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎ Π»ΠΈ ΡΠΎΠ·Π΄Π°Ρ‚ΡŒ 2 Π°Π΄ΠΌΠΈΠ½ΠΊΠΈ (admin ΠΈ user) - Π³Π΄Π΅ Π°Π΄ΠΌΠΈΠ½ ΠΈΠΌΠ΅Π΅Ρ‚ всС ΠΏΡ€Π°Π²Π°, Π° ΡŽΡΠ΅Ρ€ - Ρ€Π΅Π΄Π°ΠΊΡ‚ΠΈΡ€ΡƒΠ΅Ρ‚ Ρ‚ΠΎΠ»ΡŒΠΊΠΎ всю ΠΈΠ½Ρ„ΠΎΡ€ΠΌΠ°Ρ†ΠΈΡŽ?

Column filters not working

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

New method Display::setHeaderClass

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()
    ...
]);

ΠšΠΎΠΏΠΈΡ€ΠΎΠ²Π°Π½ΠΈΠ΅ записСй (Items copy)

ΠšΠ»ΠΈΠ΅Π½Ρ‚Π°ΠΌ часто трСбуСтся быстроС ΠΊΠ»ΠΎΠ½ΠΈΡ€ΠΎΠ²Π°Π½ΠΈΠ΅/ΠΊΠΎΠΏΠΈΡ€ΠΎΠ²Π°Π½ΠΈΠ΅ записСй Π²Π½ΡƒΡ‚Ρ€ΠΈ ΠΎΠ΄Π½ΠΎΠΉ ΠΌΠΎΠ΄Π΅Π»ΠΈ с ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠ΅ΠΌ Π½Π΅ΡΠΊΠΎΠ»ΡŒΠΊΠΈΡ… Π·Π½Π°Ρ‡Π΅Π½ΠΈΠΉ.

Π‘ΠΎΠ²ΠΌΠ΅ΡΡ‚ΠΈΠΌΠΎΡΡ‚ΡŒ с PHP 7

https://github.com/LaravelRUS/SleepingOwlAdmin/blob/development/src/Column/String.php#L5

НС заводится ΠΏΠΎΠ΄ PHP 7, Ρ‚.ΠΊ. String являСтся Π·Π°Ρ€Π΅Π·Π΅Ρ€Π²ΠΈΡ€ΠΎΠ²Π°Π½Π½Ρ‹ΠΌ словом. НуТно ΠΏΡ€ΠΈΠ΄ΡƒΠΌΠ°Ρ‚ΡŒ вмСсто String ΠΊΠ°ΠΊΠΎΠ΅-Π½ΠΈΠ±ΡƒΠ΄ΡŒ подходящСС Π½Π°Π·Π²Π°Π½ΠΈΠ΅

V2 :: Custom Form Elements

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:

  1. how can i use those custom files, per example, inside /app/admin;

  2. 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,

  • Brito

Set Custom Controller for each Model configuration on "Display" and "Create and Edit"

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..).

Questions about SleepingOwlAdmin

Hi,
I want to try and use this product, I have some questions if I may.

  1. Can I write my own functionality (interceptions) in Before/After crud operations? for example, I want to send an email when a row was been deleted.
  2. Can I intercept and write client side functionality?
  3. Can I add custom operation in the grid near "update" and "delete" icons? such as disable and run my own functionality?
  4. Can custom filters be saved for later use?

Thanks!

ВСкст ΠΊΠ½ΠΎΠΏΠΎΠΊ

Π”ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡ‚ΡŒ ΠΈΠ·ΠΌΠ΅Π½ΡΡ‚ΡŒ тСкст ΠΊΠ½ΠΎΠΏΠΎΠΊ для Ρ„ΠΎΡ€ΠΌ

Update field value if it is no empty

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()
       ...
    ]);
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.