Download the PHP package justincdotme/laravel-open-charge without Composer

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

Laravel Open Charge

Laravel Open Charge provides a fluent wrapper for the Open Charge Map POI API

The goal of this project is to enable the developer can more easily focus on their application by creating a layer of abstraction on top of the Open Charge API.

Installation

This application requires Laravel 5. OR Lumen 5.

Lumen 5.* Installation

Install the package using Composer

composer require justincdotme/laravel-open-charge

You can optionally enable Facades by uncommenting the following from bootstrap/app.php

$app->withFacades();

Register the Service Provider by adding the following to bootstrap/app.php

$app->register(Justincdotme\OpenCharge\Providers\OpenChargeServiceProvider::class);

Laravel 5.* Installation

Install the package using Composer

composer install justincdotme/loc

Register the Service Provider to the providers array in config/app.php

'providers' => [
 ...
 Justincdotme\OpenCharge\Providers\OpenChargeServiceProvider::class,
 ...
 ]

Optionally: Publish the config with the following command in Laravel:

php artisan vendor:publish and edit app/config.php

Usage

Facade

use Illuminate\Http\Request;

OpenCharge::latitude($request->latitude)
    ->longitude($request->longitude)
    ->distance(10)
    ->compactData()
    ->verbose(false)
    ->limit(4)
    ->get();    

Constructor/Method Injection

use Illuminate\Http\Request;
use Justincdotme\OpenCharge\Interfaces\OpenChargeInterface;

public function foo(OpenChargeInterface $openCharge, Request $request)
{
    return $openCharge->latitude($request->latitude)
         ->longitude($request->longitude)
         ->distance(10)
         ->compactData()
         ->verbose(false)
         ->limit(4)
         ->get(); 
}

Using OpenCharge::filters() method instead of chaining filter methods

OpenCharge::filters([
     'distance' => 10,
     'maxresults' => 20
])->get();

Note

Please note that the get() method returns a Collection from a JSON string, as such, is not compatible with output types other than JSON. Use the OpenCharge::getRaw() method in conjunction with the OpenCharge::output() method if you would like an alternate output format. The getRaw() method returns a string.

While not required, it is recommended that you supply latitude and longitude. Otherwise, the results may not be tailored to the user's location.

Additional documentation on the Open Charge Map API is beyond the scope of this readme and can be located at Open Charge Map POI API

Available Methods

Get a collection of stations. Must be the final method in the chain.

OpenCharge::get()

Get a list of stations as a raw string. Must be the final method in the chain.

OpenCharge::getRaw()

Apply an array of filters instead of calling filter methods individually. Filters should be an associative array with keys that match the list of available service params at: https://openchargemap.org/site/develop/api

OpenCharge::filters( $filters )

Latitude reference for distance calculation

OpenCharge::latitude( $latitude )

Longitude reference for distance calculation

OpenCharge::longitude( $longitude )

Output formats: json, xml, kml JSON format is recommended as highest fidelity

OpenCharge::output( $output )

Set to false to get a smaller result set with null items removed.

OpenCharge::verbose( $verbose = true )

Set to true to remove reference data objects from output. Just returns IDs for common reference data such as DataProvider etc.

OpenCharge::compactData( $compact = true )

Set to true to get a property names in camelCase format.

OpenCharge::camelCase( $camelCase = true )

Miles or KM

OpenCharge::distanceUnit( $distanceUnit )

Return results based on specified distance. Requires lattitude() and longitude() methods.

OpenCharge::distance( $distance )

Specify the name of the JSONP callback (if required), JSON response type only.

OpenCharge::callback( $callback )

Set to true to also include user comments and media items (photos) per charging location.

OpenCharge::comments( $includeComments = true )

ISO Country Code. Ex: GB, US

OpenCharge::countryCode( $countryCode )

Exact match on array of country ids. Ex: GB, US

OpenCharge::countryIds( array $countryIds )

Limit on max number of results returned.

OpenCharge::limit( $maxResults )

Exact match on array of status type ids. Open Charge Map Reference Data

OpenCharge::statusTypes( array $statusTypeIds )

Exact match on array of charge point ids. Open Charge Map Reference Data

OpenCharge::chargePoint( array $chargePointIds )

Set to false to return only non-open licensed data. Set to true to include only Open Data licensed content.

OpenCharge::openData( $opendata )

Exact match on array of data provider ids. Open Charge Map Reference Data

OpenCharge::dataProviderIds( array $dataProviderIds )

Exact match on array of usage type ids. Open Charge Map Reference Data

OpenCharge::usageTypes( array $usageTypeIds )

Exact match on array of EVSE operator ids. Open Charge Map Reference Data

OpenCharge::operators( array $operatorIds )

Exact match on array of connection type ids.

OpenCharge::connectionTypes( array $connectionTypeIds )

Exact match on array of charging level ids.

OpenCharge::chargingLevels( array $chargingLevelIds )

POIs modified since the given date (UTC)

OpenCharge::modifiedSince( $modifiedsince )

License

The MIT License (MIT)

Copyright (c) 2017 Justin Christenson

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


All versions of laravel-open-charge with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ~5
php Version >=5.4.0
guzzlehttp/guzzle Version ~5.3|~6.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 justincdotme/laravel-open-charge contains the following files

Loading the files please wait ....