Download the PHP package zenkilies/igdb-laravel without Composer

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

IGDB Laravel Wrapper

This is a Laravel-Wrapper for version 3 of the IGDB API (Apicalypse).

Basic installation

You can install this package via composer using:

The package will automatically register its service provider.

To publish the config file to config/igdb.php run:

This is the default content of the config file:

Usage

If you're familiar with the Eloquent System and the Query Builder of Laravel you will love this package as it uses a similar approach.

Models

Each endpoint of the API is mapped to its own model.

To get a list of games you simply call something like this:

Here's a list of all available Models:

Query Builder

You can use one of the defined models listed above. The search results will be mapped into the used model automatically then. This method is used in the examples below.

Otherwise you can use the Query Builder itself like this:

Select

Select which fields should be in the response. If you want to have all available fields in the response you can also skip this method as the query builder will select * by default. (Attention: This is the opposite behaviour from the Apicalypse API)

Search

Where-Clauses

Simple Where Clauses

For convenience, if you want to verify that a column is equal to a given value, you may pass the value directly as the second argument to the where method:

Or Statements

You may chain where constraints together as well as add or clauses to the query. The orWhere method accepts the same arguments as the where method:

Additional Where Clauses
whereBetween

The whereBetween method verifies that a fields's value is between two values:

whereNotBetween

The whereNotBetween method verifies that a field's value lies outside of two values:

whereIn

The whereIn method verifies that a given field's value is contained within the given array:

whereNotIn

The whereNotIn method verifies that the given field's value is not contained in the given array:

whereInAll / whereNotInAll / whereInExact / whereNotInExact

Alternatively you could use one of these methods to match against all or exactly the given array.

whereNull

The whereNull method verifies that the value of the given field is NULL:

whereNotNull

The whereNotNull method verifies that the field's value is not NULL:

whereDate

The whereDate method may be used to compare a field's value against a date:

whereYear

The whereYear method may be used to compare a fields's value against a specific year:

whereHas / whereHasNot

These methods have the same syntax as whereNull and whereNotNull and literally do the exact same thing.

Parameter Grouping

Ordering, Limit, & Offset

orderBy

The orderBy method allows you to sort the result of the query by a given field. The first argument to the orderBy method should be the field you wish to sort by, while the second argument controls the direction of the sort and may be either asc or desc:

skip / take

To limit the number of results returned from the query, or to skip a given number of results in the query, you may use the skip and take methods (Both methods are limited to your current tier, so make sure you configure them correctly in the config file):

Alternatively, you may use the limit and offset methods:

Cache

You can overwrite the default cache time for one specific query. So you can for example turn off caching for a query:

Get

To finally get results for the query, simply call get:

All

If you just want to get "all" results (limited to the per_page_limit of your tier) just call the all-Method directly on your model:

First

If you only want one result call the first-method after your query:

Find

If you know the Identifier of the model you can simply call the find-method with the identifier as a parameter:

FindOrFail

find returns null if no result were found. If you want to throw an Exception instead use findOrFail. This will throw an MarcReichel\IGDBLaravel\Exceptions\ModelNotFoundException if no result were found.

Relationships (Extends)

To extend your result use the with-method:

By default, every field (*) of the relationship is selected. If you want to define the fields of the relationship yourself you have to define the relationship as the array-key and the fields as an array:

Reading properties

Model-based approach

If you used the Model-based approach you can simply get a property:

If you want to access a property which does not exist null is returned:

Query-Builder-based approach

If you used the Query Builder itself you must check if a property exists yourself.

TODO List

Contribution

Pull requests are welcome :)


All versions of igdb-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2.5
laravel/framework Version 5.8.*|^6.0|^7.0
guzzlehttp/guzzle Version ~6.0
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 zenkilies/igdb-laravel contains the following files

Loading the files please wait ....