Download the PHP package nedoto/laravel-client without Composer

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

Nedoto Laravel Client

A Laravel package to connect to the Nedoto API.

References:

Installation

This package requires PHP >=8.1 and is built for Laravel >=11.x or higher.

Installation with Composer:

Publish the package configuration:

Open your .env file and add the NEDOTO_API_KEY env var using your api-key created at https://app.nedoto.com/api-keys.

Note: before start retrieving your configuration, be sure to enable the Project, Environment, Configuration and Api key in https://app.nedoto.com.

Usage

You can choose between using the Facade or injecting the Nedoto client to retrieve your configuration.
Continue reading to understand how to use both.

Using the Facade

You can use the NedotoClientFacade facade to retrieve your configuration from Nedoto API.

Inject the Nedoto client

To retrieve your configuration from Nedoto API you should add a reference to the Nedoto\Client\NedotoClient to you class and then use the Client to retrieve your configuration with the unique key that is the variable slug.

As shown in the example below, the $response object is of type Nedoto\Client\Response and with it, you can retrieve the Nedoto\Configuration object.
From the Configuration object you can access your configuration value calling the getValue() method.

The Nedoto Response

After the call to the get() method, you'll receive a Nedoto\Client\Response.

Understand if the Nedoto response is ok

To understand if everything went fine after retrieving your configuration, you should use the getStatus() method.
It will return a standard HTTP status code.

Alternatively you could you use the failed() method that will inform you if there was a failure by returning a boolean value if the HTTP status code is different from 200 (HTTP OK).

Understand the errors

After checking if the status of the response you may want to understand which errors happened during the API request.
For this you could use the getErrors() method.

The getErrors() method will return an array of reasons explaining what's wrong with the request.

Retrieve the Configuration

To retrieve your configuration value you must use the getConfiguration() method.

Reading you configuration

After you have your Nedoto\Configuration object you can access different information explained below.

Retrieve the value

Probably the most important thing to read in your configuration is actually the value.
To do that you should simply use the getValue() method.

Note: the getValue() method will return the value already casted to the type you defined in the configuration in https://app.nedoto.com/configurations.

Understand the type

Since Nedoto gives you the possibility to define the type of your configuration you can retrieve it using the getType() method.

Note: You don't need to cast the value to the type you want, since the getValue() method will return the value already casted.

Access the creation date

By using the getCreatedAt() you can access the creation date of the configuration.

Access the update date

By using the getUpdatedAt() you can access the update date of the configuration.

Want to improve something?

Please feel free to open a PR if you want to improve something on this repository.


All versions of laravel-client with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^11.2
illuminate/http Version ^11.2
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 nedoto/laravel-client contains the following files

Loading the files please wait ....