Download the PHP package clusterpoint/laravel-clusterpoint without Composer
On this page you can find all versions of the php package clusterpoint/laravel-clusterpoint. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-clusterpoint
Clusterpoint 4.x PHP Client API - Laravel Package
Official Documentation
Documentation for the API can be found on the Clusterpoint website.
Install
- Install the package.
composer require clusterpoint/laravel-clusterpoint
- Register Service Provider in your
config/app.php
file.
Clusterpoint\ClusterpointServiceProvider::class
- Publish config file.
php artisan vendor:publish --provider="Clusterpoint\ClusterpointServiceProvider"
- Edit config – The main config file path is
config/clusterpoint.php
however we recommend to add your credentials to your .env file in laravel project root directory.
Usage examples
- Client Usage Example
- Model Usage Example
- Route Model Binding Example
- Multiple connections Example
Client Usage Example
Here you can see standart Laravel Controller that uses our service.
Model Usage Example
First create your model in app
folder:
Now you can use model inside the controller.
Route Model Binding Example
We will use model created above to show this example, first bind your model in app/Http/routes.php
file like this:
Now if you pass the primary key value in your url like myweb.dev/examples/42
you can access the document already inside your controller like this.
Multiple connections Example
You can set multiple connections and use what you needed in the Model.
First add a connection setting array in the main config file config/clusterpoint.php
.
For example a connection named "test"
However we recommend you to add your credentials to your .env file in the laravel project root directory.
Now You can use the connection in Your Model:
Support, Feature Requests & Bug Reports
- GitHub issues for bug reports and feature requests
- StackOverflow to ask questions (please make sure to use the clusterpoint tag)
- You can also send an e-mail to our support team at [email protected]
License
Clusterpoint 4.0 PHP Client API - Laravel Package is open-sourced software licensed under the MIT license