rafni/laravel-toolkit

Some tools for Laravel development, only commands and helpers to streamline developments

v5.1.2 2017-09-27 06:12 UTC

This package is not auto-updated.

Last update: 2024-04-30 07:49:35 UTC


README

Versions

This is version 5.1 of the development kit for the Laravel 5.0 framework or higher.

Installation

To install this update your composer.json file to require

    "rafni/laravel-toolkit" : "~5.*"

Once the dependencies have been downloaded, add the service provider to your config/app.php file

    'providers' => [
        ...
        Rafni\LaravelToolkit\Providers\LaravelToolkitServiceProvider::class
        ...
    ]

You are done with the installation!

How to use

Once installed, use the scaffold provided by the tool kit is very simple, just write in the artisan console of your project the following command:

    php artisan toolkit:package "service_name"

Use the command without quotes and in singular.

In the artisan console, if the process was successful, it will give you the access routes of the new generated resource, copy and paste these routes in the route file corresponding to your version of Laravel.

This will automatically generate the following files in your project:

    app/
        Http/
            Controllers/
                NameSpace/
                    ServiceNameController.php
        Repositories/
            NameSpace/
                ServiceNameEloquent.php
                ServiceNameService.php
                ServiceNameContract.php
    resources/
        views/
            NameSpace/
                index.blade.php
                show.blade.php
                create.blade.php
                edit.blade.php
                

Finally, in order for the contracts injected in the construction of the controllers do not result in a critical error, you must bind them to the service that will manage the service logic.

In your app/providers/AppServiceProvider.php file, bind them as follows:

    public function register()
    {
        ...
        $this->app->bind(ExampleServiceContract::class, ExampleService::class);
        ...
    }

Documentation

For documentation on this package, please visit the wiki.

Change log

Please see the releases page https://github.com/rafni/laravel-toolkit/releases

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email jose at ditecnologia dot com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.