synga-nl / laravel-development-kit by Synga

Development Kit for Laravel to start your projects very easy
381
2
3
Package Data
Maintainer Username: Synga
Maintainer Contact: info@synga.nl (Synga)
Package Create Date: 2017-08-13
Package Last Update: 2018-05-09
Language: PHP
License: Unknown
Last Refreshed: 2024-04-25 15:16:22
Package Statistics
Total Downloads: 381
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 2
Total Watchers: 3
Total Forks: 0
Total Open Issues: 0

Laravel Development Kit (LDK)

This package provides some easy ways to develop with laravel. It is mainly focusses on setting up laravel and add easy ways to kickstart your development.

Installation

Install with composer

$ composer require synga/laravel-development-kit:dev-master

Publish the package

$ php artisan vendor:publish --provider="Synga\LaravelDevelopment\LaravelDevelopmentServiceProvider"

Functionalities

This packages has currently two main functionalities: Install packages and executing "make" commands for a certain package.

Install packages

In the development.php config file you can specify which packages should be installed. You can do this by providing an array. The array key starts with the name of the package (from Packagist).

return [
    'barryvdh/laravel-ide-helper' => [
        'composer' => [
            'version' => '^3.1',
            'commands' => [
                'post-update-cmd' => [
                    'artisan' => [
                        ['command' => 'ide-helper:generate', 'after' => 'Illuminate\\Foundation\\ComposerScripts::postInstall'],
                        ['command' => 'ide-helper:meta', 'after' => 'Illuminate\\Foundation\\ComposerScripts::postInstall']
                    ],
                    'shell' => [
                        // No shell commands for this package
                    ]
                ],
                'post-install-cmd' => [
                    'artisan' => [
                        ['command' => 'ide-helper:generate', 'after' => 'Illuminate\\Foundation\\ComposerScripts::postInstall'],
                        ['command' => 'ide-helper:meta', 'after' => 'Illuminate\\Foundation\\ComposerScripts::postInstall']
                    ],
                ]
            ],
        ],
        'dev' => true,
        'service_providers' => [
            \Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
        ],
        'aliases' => [
            // no aliases for this package
        ]
    ],
];

The basic anatomy of the array is as follows:

  • Composer: This is explained below
  • Dev: is the package only needed for the development environment
  • Service provider: specify all service providers needed for this package
  • Aliases: specify all aliases needed for this package

With the composer key you can specify the following keys:

  • Version: You can add any version constraint supported by Composer.
  • Commands: You can add commands to certain events in composer. A list of events can be found here: https://getcomposer.org/doc/articles/scripts.md. Each event can have two keys: artisan and shell.
    • Artisan: an array with command (do not add php artisan) and a key after, which indicates after which command it should be executed.
    • Shell: an array with the command and after which command it should execute

Execute commands for a package

This package provides the bash php artisan development:command command.

When you execute this command, you get the question for which package you want to execute a command. All the packages in the packages directory (made with the package Jeroen-G/packager) are listed. After the selection of the package you get the question which command you want to execute. After the selection of the command you can specify some arguments. After you executed the command the whole process starts again.