Download the PHP package blitheness/laravel-deputy without Composer

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

This project has been archived, and no further support will be provided. Anyone is welcome to fork the project to continue development.

laravel-deputy

Laravel package for interacting with the Deputy API. Deputy is a powerful business management system, available from https://www.deputy.com.

This package is provided AS-IS, with no guarantee of functionality or support. This package is not meant to work for every use case. More information may be found in this repository's LICENSE file.

Some basic instructions are provided below.

Installation

composer require blitheness/laravel-deputy dev-master

php artisan vendor:publish (then enter number for Blitheness\Deputy\DeputyServiceProvider)

Configuration

Either update config/deputy.php to change the 'url' and 'token' values, or set 'DEPUTY_URL' and 'DEPUTY_TOKEN' values in your .env file.

The URL is the Deputy subdomain that your company is using, such as "mycompany.eu.deputy.com", without any "http://", "https://", or any trailing slashes.

The token is your Deputy API 'Permanent Token', which may be created by a System Administrator in your organisation. An authorised user may generate a token by following the instructions in the Deputy API documentation: https://www.deputy.com/api-doc/API/Authentication

Usage

Resources

Facades

To make use of a Deputy 'resource', use a real-time Facade.

Add this to the top of your controller use Facades\Blitheness\Deputy\Models\RESOURCE_NAME; where RESOURCE_NAME is a resource from the list above.

Retrieving Data

Known ID

$result = Resource::find(ID)

Where Resource is a resource from the list above, and ID is the ID of the resource in Deputy that you are attempting to find.

Searching

To search, use the 'search' method on that resource's real-time facade:

$results = Resource::search('FieldName', 'eq', 'Value')->get();

More than one condition may be used per query by chaining the search calls together, such as:

$results = Resource::search('FieldName', 'eq', 'Value')->search('Active', 'eq', '1')->get();

Updating Resources

Model attributes

To update a resource, it must not be a read-only resource.

First, retrieve the resource you wish to modify, for example:

$resource = Employee::find(123);

Secondly, change the desired attribute(s) on the model:

$resource->FirstName = "New First Name";

Finally, call the save method on the model:

$resource->save()

Background tasks (Jobs)

Remove employee from location

To disassociate an employee from a location, you must know the employee's ID and the ID of the location.

Then, one of the following jobs may be dispatched:

Blitheness\Deputy\Jobs\DisassociateEmployee

Firstly, include this in the controller file before your class declaration:

use Blitheness\Deputy\Jobs\DisassociateEmployee;

Then, write the following where you would like to dispatch the job:

DisassociateEmployee::dispatch($deputyId, $locationId);

where deputyId is the Employee ID, and locationId is the ID of the location that they are to be removed from.


All versions of laravel-deputy with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version ^5.6
illuminate/support Version ^5.6
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 blitheness/laravel-deputy contains the following files

Loading the files please wait ...