Download the PHP package biliboobrian/microservice-crud without Composer

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

Lush Digital - CRUD

A CRUD convenience layer for microservices built in Lumen.

Description

This package is intended to provide a convenient layer on top of Lumen to streamline the process of developing a RESTful CRUD microservice. It reduces the repetitive nature of writing controllers, models and CRUD logic over and over again.

Package Contents

Installation

Install the package as normal:

The package requires that the following changes are made to the Lumen config in bootstrap/app.php

Usage

To create a new CRUD resource first extend your model from \LushDigital\MicroServiceModelUtils\Models\MicroServiceBaseModel. The model must also implement the LushDigital\MicroServiceCrud\Models\CrudModelInterface interface.

Next you need to create a controller which extends from \LushDigital\MicroServiceCrud\Http\Controllers\CrudController

Finally if you are using caching you need to register the Crud observer against your model. Do this by editing the existing app/Providers/AppServiceProvider.php class (or add a new service provider) like so:

Make sure that your service provider is added (or uncommented) in bootstrap/app.php:

Model

Note that above the model is called Example and the controller is called ExamplesController. This follows the plural pattern you're used to with Laravel. Basically the controller name needs to be the plural version of the model plus 'Controller'.

This can be changed by overriding the $modelBaseClass attribute in the controller:

Model Namespace

The CRUD controller assumes the model exists in the App\Models namespace (e.g. App\Controllers\ExamplesController => App\Models\Example).

This can be changed by overriding the $modelNamespace attribute:

Cache Attributes

The package provides support for caching data based on any attribute of a model. By default the package will cache data using the id attribute only. This works using cache keys, so for an instance of the Example model with id 1 the following cache keys will be set on read and cleared on update/delete:

Note the :index cache key is always used for the indexing endpoint listing all model instances.

To cache based on other attributes just override the $attributeCacheKeys attribute in your model:

So in this cache Example (ID: 1) with a name of 'test' would have a cache key of examples:name:test

Routing

Once your controller and model are set up you need to configure routes. The package provides logic for the standard REST endpoints (GET, POST, PUT, DELETE). You can use as many or as few as you like, an example of all routes would be:


All versions of microservice-crud with dependencies

PHP Build Version
Package Version
Requires laravel/lumen-framework Version ^5.3 || 6.* || 7.* || 8.*
biliboobrian/microservice-core Version ~1.0
biliboobrian/microservice-model-utils Version ~1.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 biliboobrian/microservice-crud contains the following files

Loading the files please wait ....