Download the PHP package cals/rsp without Composer

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

RSP

About RSP

RSP is a web application library used to make things easier while you building a plain Laravel application. Besides, it provides some efficient commands to let you free while you're coding.

RSP is short for Repository Service and Presenter.

How to use

Installation

You can run composer require cals/rsp to install RSP from Packagist.

Or, you can add "cals/rsp": "~2.0" to your composer.json and then run composer update in your terminal to install it.

Configuration

After you install the RSP, you should put Cals\RSP\RSPServiceProvider::class in your config/app.php providers array to make it work.

If you use Laravel 5.5 and after, you don't need do it cause laravel will auto load the provider.

Then you should run php artisan vendor:publish --tag=rsp to publish rsp.php.

Usage

Repository

You can use make:repository to create a repository and its' interface, or you can create them manually if you want to. Remember that the repository should extends Cals\RSP\Repositories\Implementations\Repository if you create it manually.

The repository is like below:

And the interface is like below:

As you can see, RSP use Eloquent ORM to operate database, so you should create models to map tables. We recommend you and only put your models in app/Models/ instead of app/ which will make your project more plain.

The repository we extended provides nine methods:

While the returned value has only one record when you use get(array $columns = ['*'],array $crendentials = null), it is still an instance of Illuminate\Database\Eloquent\Collection. So if you want to find only one record and wish its' type is Illuminate\Database\Eloquent\Model, you can use find(array $credentials = null) or finish it yourself using the method builder() we provided.

While we use RSP, we do not use repository directly in controller. Repository should always provide methods to let service to use it.

Service

You can use make:service to create a service and its' interface, or you can create them manually if you want to. Remember that the service should extends Cals\RSP\Services\Implementations\Service if you create it manually.

The service is like below:

And the interface is like below:

The service we extended provides eight methods:

These eight methods call methods provided by repository simply. So you can override it to satisfy your needs. And the type of returned value is like above listed in Repository.

Presenter

You can use make:presenter to create a presenter and its' interface, or you can create them manually if you want to. Remember that the presenter should extends Cals\RSP\Presenters\Implementations\Presenter if you create it manually.

The presenter is like below:

And the interface is like below:

The presenter we extended provides two methods:

The first method is used to limit length and the second method is used to show different form the time you give to now.

Bind

After you create your class, you need put it in rsp.php:

Such as:

Then Laravel can bind the interface on the implementation.

Commands

We provide some commands for you to create files which have some basic codes, and you can put your own code into it to satisfy your needs.

The commands list below:

Contributing

Thank you for considering contributing to the RSP Architecture library!

Author

Cals Ranna

License

The RSP Architecture is an open-sourced library licensed under the MIT license.


All versions of rsp with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
laravel/framework 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 cals/rsp contains the following files

Loading the files please wait ....