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

Shortcuts Bundle Laravel Package

appventus/shortcuts-bundle

View on GitHub
Deep Wiki
Context7

AppVentus

Gitter License Version

Awesome Shortcuts Bundle

What is the point ?

This bundle allows you to easily add and use shortcuts for your dev apps.

Install

This procedure describes the installation of the project for use in a virtual machine vagrant.

Recovery Bundle

Composer

Add the following lines in your composer.json :

    {
        "require": {
            "appventus/shortcuts-bundle": "dev-master"
        }
    }

Then execute the following command:

    php composer.phar update

Bundle activation

In your AppKernel.php add the following lines :

<?php

public function registerBundles()
{
    $bundles = array(
        // ...
        new AppVentus\Awesome\ShortcutsBundle\AvAwesomeShortcutsBundle(),
    );
}

Configuration

Twig

Add the following lines in Config.yml :

    # Sf=2.*
    twig:
        form:
            resources:
                - 'AvAwesomeShortcutsBundle::fields.html.twig'# Twig Configuration
    # Sf>=3.*
    twig:
        form_themes:
            - 'AvAwesomeShortcutsBundle::fields.html.twig'

In your layout file, load the following files :

    '@AvAwesomeShortcutsBundle/Resources/public/css/datepicker.css'
    '@AvAwesomeShortcutsBundle/Resources/public/js/bootstrap-datepicker.js'

Using shortcuts

A service allows the use of functions used in many applications.

Eg. in a controller:

$shorcutService = $this->get('av.shorcuts');
$shorcutService->getSession(...
$shorcutService->setSession(...
$shorcutService->createAndQueueMail(...
$shorcutService->createAndSendMail(...

View ShortcutService file for a complete list of shortcuts and their parametres.

FormErrorService

As it is common to submit forms by ajax, it is desired to return the error forms of a string

The FormErrorService transforms errors on a form (and its sub-forms) into a string.

Eg. in a controller:

	$form = ...  //some form

	if ($form->isValid()) {
		...
	} else {
		$formErrorService = $this->get('av.form_error_service');
		$errorsAsString = $formErrorService->getRecursiveReadableErrors($form);
	}

Integration with AvAlertifyBundle

This bundle brings a lot of shortcuts for AvAlertify bundle to standardize all alerts for your application.

Instead of using:

$this->get('session')->getFlashBag()->add('noty', array(
        'type'              => $type,
        'layout'            => $layout,
        'body'              => $content,
        'translationDomain' => $translationDomain
    )
);

or worse

$this->session->getFlashBag()->add('success', 'Congratulations !');

We can now use the following shortcuts from the av.shortcuts Service :

$this->container->get('av.shortcuts')->congrat($content, $layout, $translationDomain);

or any of our controller inheriting AwesomeController :

$this->congrat('Congratulations !');         // Success
$this->warn('Careful, this is important !'); // Warning
$this->inform('Did you know ?');             // Information
$this->scold('Oups something went wrong !'); // Error

RedactorType

Add the assetic injector redactor tag

$redactorOptions = [
    'lang' => $this->request->getLocale(),
    'plugins' => ['video'],
    'buttons' => ['html', 'formatting', 'bold', 'italic', 'underline', 'deleted', 'unorderedlist', 'orderedlist', 'outdent', 'indent', 'image', 'video', 'link', 'alignment', 'horizontalrule'],
    'imageUpload' => '/bundles/avawesomeshortcuts/libs/redactor/scripts/image_upload.php',
];

$builder->add('description', RedactorType::class, [
	'options' => $redactorOptions
]);
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.
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager