Download the PHP package vahid/respond without Composer

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

Build Status Scrutinizer Code Quality Latest Stable Version Total Downloads License

Laravel Respond

This package is provided to be used on lumen and laravel framework v5 and upper and it gives clean methods to handle json response with specific predetermined messages.

Requirement

Install

Via Composer

Go to your project path and run this code in your terminal

Or edit your composer.json to require the package.

Then run composer update in your terminal to pull it in

Config

Laravel

you will need to add the service provider to the providers array in your config/app.php as follows:

Next, also in the app.php config file, under the aliases array, you may want to add the Respond facade.

Laravel 4:

Laravel 5:

Lumen

Added into providers

you will need to add the service provider beside another register service providers on bootstrap/app.php as follows:

after that you need create a helper and add config_path function.

Create config_path helper for Lumen

Create a file called GeneralHelpers.php in the app/Helpers directory. Paste the code inside it.

Go to composer.json and add files to autoload so that it looks like this:

Run composer dump-autoload to load the newly created helpers file.

Usage

You can use these methods in deffernt ways:

There are hot ones for quick usage, besides some provided to manage outputs on your own way

Some are shown below:

When request succeeds and contains data to return as a result:

When deletion action succeeds:

When updating succeeds:

When insertion succeeds:

When deletion action fails:

When updating fails:

when insertion fails:

Not Found Error:

When db connetion is refused:

When parameters entered are wrong:

When requested method is not allowed:

Validation errors:

Note: If you use Laravel FormRequest, to prevent iteration, we recommend try this method in App\Http\Request.php and override response method of Illuminate FormRequest

customization

Set custom message for methods is like this:

And you can do more:

License

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


All versions of respond with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version >=5.1
php 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 vahid/respond contains the following files

Loading the files please wait ....