Download the PHP package 4myth/api without Composer

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

MyTh API Manager

Latest Stable Version License Total Downloads

For Laravel 5.5 and higher

This package allows you to sync your data with Laravel 5.5 and higher. Contains two sections of manger and clint

Package Installation

Require this package in your composer.json and update composer.

Laravel

Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider/Facade.

You can use the Alias for shorter code.

Finally you can publish the package:

Getting Started

1- Manager Side

Example multiple clients:

Example multiple models with clients:

Client config:

The key of client array must be the client name in your application.

All options array keys: secret,base_uri,options,models

  1. secret: Client's authentication secret, which you can obtain from your client.
  2. base_uri: Client api url. Example: http://127.0.0.1/api/v1
  3. options: Array of your client options. available options: http.
  4. models: Array of your models, will be able to syc with specific client.
    • uri: The url or prefix of model at your client software.
    • transformer: This option will be used automatically when your system sync send model data to your client, you must make a new transformer for each client's model.

Setup

  1. Model.
  2. Model transformer.

Model

Before you begin to use the package you must setup your model by use package trait.

Model transformer

first to make a new model transformer we have configure in our config, we can execute artisan command:

then we will find the transformer inside app directory app\TransformerName.php

Transformer file:

The body method must be return an array data that you will send when syncing this model with Client.

Example:

The client will receive in body request this array.

Usage

Access to client:

to access your client inside your application you can use the facade package Api

Access to client models:

Send data to client

you can send your data with multiple ways:

Response

The response using class ResponseInterface package contains methods you can access easily in your code

  1. request: \GuzzleHttp\Psr7\Response See: http://docs.guzzlephp.org
  2. response: array client response
  3. client_id: the unique id at client in database.

Client locale storage

Mark your models

set must sync with client

set synced with client

unsync model with client Delete relation


All versions of api with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
laravel/framework Version >=5.8
ext-json Version *
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 4myth/api contains the following files

Loading the files please wait ....