<commit_before># Directus API Wrapper for Laravel 5

## Installation

`TODO`

## Usage

`TODO`

## License

MIT<commit_msg>updating readme<commit_after><p align="center">
    <a href="https://packagist.org/packages/theplanworks/directus-laravel"><img src="https://poser.pugx.org/theplanworks/directus-laravel/v/stable.svg" alt="Latest Stable Version"></a>
    <a href="https://packagist.org/packages/theplanworks/directus-laravel"><img src="https://poser.pugx.org/theplanworks/directus-laravel/d/total.svg" alt="Total Downloads"></a>
    <a href="https://packagist.org/packages/theplanworks/directus-laravel"><img src="https://poser.pugx.org/theplanworks/directus-laravel/license.svg" alt="License"></a>
</p>

# Directus API Wrapper for Laravel 5

This package allows users to easily consume the REST API provided by the [Directus](https://getdirectus.com) Headless CMS system in any Laravel app.

## Installation

Install via [composer](https://getcomposer.org) using the command line:

`composer require theplanworks/directus-laravel`

In Laravel 5, update the `config/app.php` providers array with the Service Provider:

`thePLAN\DirectusLaravel\DirectusLaravelServiceProvider::class,`

### Configuration

By default, the package is set up to use the following configuration values read from your `.env` file:

+ `DIRECTUS_CMS_URL` - The base URL of your CMS instance.
+ `DIRECTUS_API_KEY` - The key generated by the CMS and associated with a valid user that authenticates requests

If you would like to use a config file, you can publish the default config by running the following command:

`php artisan vendor:publish --provider="thePLAN\DirectusLaravel\DirectusLaravelServiceProvider"`

This will publish a config file to `config/directus-laravel.php`.

## Usage

To utilize the API Wrapper, use dependency injection to resolve:

```php
public function __construct(DirectusLaravel $directusAPI)
{
    $this->api = $directusAPI;
}
```

Then you can make the following calls:

### getTableRows

```php
$value = $this->api->getTableRows($table);
```

Where `$table` is the name of the Directus table you would like to access.

### getTableRow

```php
$value = $this->api->getTableRow($table, $id);
```

Where `$table` is the name of the Directus table you would like to access, and `$id` is the unique ID of the record being requested.

### getFile

```php
$this->api->getFile($url);
```

Where `$url` is the file url you would like to return, such as `/storage/uploads/00000000001.png`.

## License

This package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).
{'fraction_non_alphanumeric': 0.12289433384379786, 'fraction_numerical': 0.005359877488514548, 'mean_word_length': 5.048611111111111, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 21, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1236611', 'n_tokens_mistral': 837, 'n_tokens_neox': 801, 'n_words': 258}