Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Sonata Extra Bundle Laravel Package

draw/sonata-extra-bundle

View on GitHub
Deep Wiki
Context7

DrawSonataExtraBundle

This bundle adds some functionalities to the Sonata Project different bundle.

Detect admin argument

The current way to define admin argument is that way:

App\Sonata\Admin\UserAdmin:
    arguments: [ ~, 'App\Entity\User', ~ ]

You can now omit the constructor argument by setting default value in your constructor class:

namespace App\Sonata\Admin;

user App\Entity\User;
use Sonata\AdminBundle\Admin\AbstractAdmin;

class UserAdmin extends AbstractAdmin
{
    public function __construct($code, $class = User::class, $baseControllerName = null)
    {
        parent::__construct($code, $class, $baseControllerName);
    }
}

A compiler will extract the default value from the argument. They need to have the exact same name to be extracted. If you have defined the arguments from any other mean prior to the compiler pass they will not be replaced.

Fix menu depth when only 1 sub menu

When a menu just have one submenu it can be fix to remove the submenu.

This:

User
 --> List
Entity
 --> List
Section
 --> Entity1 List
 --> Entity2 List

Would become:

User
Entity
Section
 --> Entity1 List
 --> Entity2 List

Enable this feature in config:

draw_sonata_extra:
  fix_menu_depth: true

New Template types

Some templates type are added to the default Sonata templates.

By default, all the js and css files are added to the sonata_admin.assets.extra_javascripts and `sonata_admin.assets.extra_stylesheets section.

If you want to install them manually you can set the draw_sonata_extra.install_assets to false.

Show

json

Allow to display a json data based on the https://github.com/abodelot/jquery.json-viewer.

If you want to import the assets via webpack you must import this:

import 'jquery.json-viewer/json-viewer/jquery.json-viewer.js';
import 'jquery.json-viewer/json-viewer/jquery.json-viewer.css';
import '../public/bundles/drawsonataextra/js/json_viewer.js';

Note: Don't forget to install the jquery.json-viewer package.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
comsave/common
alecsammon/php-raml-parser
chrome-php/wrench
lendable/composer-license-checker
typhoon/reflection
mesilov/moneyphp-percentage
mike42/gfx-php
bookdown/themes
aura/view
aura/html
aura/cli
povils/phpmnd
nayjest/manipulator
omnipay/tests
psr-mock/http-message-implementation
psr-mock/http-factory-implementation
psr-mock/http-client-implementation
voku/email-check
voku/urlify
rtheunissen/guzzle-log-middleware