Download the PHP package mixerapi/crud without Composer

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

MixerApi CRUD

![Stability][ico-stability]

Version Build Coverage MixerApi CakePHP Minimum PHP Version

This plugin provides CRUD (Create/Read/Update/Delete) services to your RESTful APIs controller actions using CakePHP's dependency injection container.

You may also want to look at CakePHP Crud which doesn't rely on dependency injection. If you're using this plugin without MixerApi/ExceptionRender or for a non-API projects read below.

Installation

Alternatively after composer installing you can manually load the plugin in your Application:

See Plugin Options for additional configurations.

Usage

Once enabled, the following services may be injected into your controller actions.

Interface Injected Service Use-cases
CreateInterface MixerApi\Crud\Service\Create add() actions
ReadInterface MixerApi\Crud\Service\Read view() actions
UpdateInterface MixerApi\Crud\Service\Update edit() actions
DeleteInterface MixerApi\Crud\Service\Delete delete() actions
SearchInterface MixerApi\Crud\Service\Search index() actions

All Crud services infer the table name from the controller, you can change the table name by calling the setTableName($name) method.

If you are using MixerApi\ExceptionRender then an event will catch validation errors and handle the response for you, otherwise a MixerApi\Crud\Exception\ResourceWriteException is thrown.

See below regarding path parameters if your path parameter is not id.

Create

Note, save() with $options is supported.

Read

Note, read() with $options is supported.

Return a CakePHP Query object instead:

Update

Note, update() with $options is supported.

Delete

Note, delete() with $options is supported.

Search

The Search service works with Pagination and optionally with CakePHP Search.

Example:

To use CakePHP Search initialize the component as normal in your controllers initialize() method.

For custom CakePHP Search collections call the setCollection($name) method:

Return a CakePHP Query object instead:

Serialization

Serialization is handled by a Controller.beforeRender listener. It serializes the first viewVar found for all CRUD operations and will not run for non-crud operations. See Options for disabling serialization.

Allowed HTTP Methods

Allowed methods is handled by a Controller.initialize listener. See Plugin Options for disabling or modifying the defaults.

Action HTTP method(s)
index() GET
view() GET
add() POST
edit() POST, PUT, and PATCH
delete() DELETE

You may also call setAllowMethods($methods) on any service to overwrite the default behavior. This accepts a string or any array as an argument just like the native $request->allowedMethods().

Plugin Options

You may customize functionality by passing in an options array when adding the plugin.

Customize allowed HTTP methods:

To disable automatic $request->allowMethod() entirely:

Disable automatic serialization:

Misc

Path Parameters

If your path parameter for the resource is not id then pass the identifier as the second argument:

The above also works for Update and Delete.

Other Usages

This plugin works best with API projects using MixerApi/ExceptionRender which uses events to set the response in the event of an error. If your project isn't using ExceptionRender or you're not an API you can write a custom exception renderer and look for ResourceWriteException, then alter the viewVars output using the EntityInterface from ResourceWriteException::getEntity().

Read the CakePHP Custom ExceptionRenderer documentation for more information.


All versions of crud with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
cakephp/cakephp Version ^5.0
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 mixerapi/crud contains the following files

Loading the files please wait ....