Download the PHP package dinkara/repobuilder without Composer

On this page you can find all versions of the php package dinkara/repobuilder. 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 repobuilder

RepositoryBuilder

Repobuilder is addon for PHP Laravel framework that implements Repository pattern and adds an extra level for database communication in our project architecture. Instead of accessing models and writing queries in your Controller classes or Models, you should place them here. This way you will create single access point with controlled set of functions to your database. Library also has necessary Laravel commands for easy creation of complete set of classes and files (migrations, models and repositories).

Main advantages are:

Requirements

Composer Install

Publish service

Add the service provider in config/app.php:

For publishing new services you need to execute the following line

Now you are ready to use new features. To check if everything is fine, execute following command

If you can see make:repo option everything is ready.

How to use command

Examples :

In order to use your repositories as standard Laravel services you need to add following lines to your app/Providers/AppServiceProvider.php. This will point interface to proper class so Laravel knows which class to load when that interface is initialized.

This command will create new folder User under App\Repositories and make two new files inside of them. Interface IUserRepo and class EloquentUser.

This command will create same like first command but it will also create new migration with given name.

This command will create same like first command but it will also create new model with given name in App\Models.

This command will create migration, model and necessary repository classes.

How to use repositories

Repositories created with this library can be used in Controllers, Services, Seeders or any other class in your Laravel application.

Basic example:

Base interface with all available functions:

Function "__call" is a PHP magic function. It can be used to query database by attribute name.

Example:

This can only be used for "findBy" function and it is recommended to use it only in combination with attributes that are unique, because it returns only first record.

Adding custom function to your repositories

If you want to add custom or override existing functions in your repositories, this can be done easily by changing interface and class for specific repository.

Let's have a look at our User example:

You should first add new functions to App\Repositories\User\IUserRepo.php interface like shown below.

Afterwards you should define that functions in App\Repositories\User\EloquentUser.php class.

Repository pattern in this library is meant to cache state of your model object. This allows us to call multiple functions on the same model object (like we did with create and attachRole in the code above). To achieve this you have to return finalize function and pass it your model.

Do note that not all functions are meant to save state (for example when you have complex queries that return collection of data), in that case you should clear state of your model and just return eloquent result.

All suggestions and advices are welcome! So please send us your feedback and we will try to improve this library


All versions of repobuilder with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ~5.1
php Version ~5.6|~7.0
sofa/eloquence Version ^5.5
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 dinkara/repobuilder contains the following files

Loading the files please wait ....