Download the PHP package ins0mniac/service-generator without Composer

On this page you can find all versions of the php package ins0mniac/service-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package service-generator

Laravel Service generator for Laravel applications

Introduction

Service generator provides commands to create services, interfaces and providers and register the dependencies in the dependency container.

With this package, you can generate new files (services, interfaces and providers) only with "artisan" command just as controllers creation. It is not necessary to list the provider in app.php file. The process of listing providers in app.php and registering the dependencies in the providers is automated.

The list of the available commands are shown below:

Features

Official Documentation

Installation

You can install this package via Composer by running this command:

NOTE : The package will automatically register itself.

Commands

For services creating:

Plain service

You can generate plain service (php file) with :

If you don't specify the name of the service, Laravel will ask you to type it.

With this command, Laravel will generate new file with all the necessary attributes as namespace, class name, etc. The file will be generated in Services/* directory (based of the name of the service), so if you type service name as Users/User, the service file will be located in Services/Users with name of UserService.

Service with implementation

You can generate service which implements interface:

class NameOfTheService impements NameOfTheInterface

or just

If you don't specify name of the service and/or interface, Laravel will ask you for them.

After you type the interface name, Laravel will ask you if you want to register dependency in the container. If you want to register it, just type y and enter the name of the Provider (if provider didn't exists, the command will create new one and publish it in app.php). After entering the provider name, you should specify the type of the registering - bind or singleton.

NOTE : This command will create new service file, so if you shouldn't type name of the existing file!

In the end of the generation process you will have:

For interfaces creating:

Interface only

You can generate only interface (php file) with :

If you don't specify the name of the interface, Laravel will ask you to type it.

Generate interface and implement it from new or existing service

You can generate interface and implement it:

class NameOfTheService impements NameOfTheInterface

or just

If you don't specify name of the interface and/or service, Laravel will ask you for them.

After you type the interface name, Laravel will ask you if you want to register dependency in the container. If you want to register it, just type y and enter the name of the Provider (if provider didn't exists, the command will create new one and publish it in app.php). After entering the provider name, you should specify the type of the registering - bind or singleton.

In the end of the generation process you will have:

For provider creating:

Provider only

You can generate only provider (php file) with :

If you don't specify the name of the provider, Laravel will ask you to type it.

Generate or get existing provider and register dependency in it

You can generate or get existing provider:

or just

If you don't specify name, Laravel will ask you for them.

After you type the provider name, Laravel will ask you for the names of service and interface and the type of the registering - bind or singleton.

In the end of the generation process you will have:

Examples of generated files

Coming soon

The next stage will be adding --resource option to create:service and create:interface commands. This will allow you to generate files with resource methods - getAll(), findByKey(Model $model), etc.

License

Laravel Service Generator is open-sourced software licensed under the MIT license.


All versions of service-generator with dependencies

PHP Build Version
Package Version
Requires php Version >=v7.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ins0mniac/service-generator contains the following files

Loading the files please wait ....