PHPackages                             domexx/ares - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. domexx/ares

ActiveLibrary[Caching](/categories/caching)

domexx/ares
===========

Fast and convenient skeleton to build your beautiful api

1.0.0(5y ago)401MITPHP

Since Nov 16Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Domexx/ares)[ Packagist](https://packagist.org/packages/domexx/ares)[ RSS](/packages/domexx-ares/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Ares
----

[](#ares)

[![CodeFactor](https://camo.githubusercontent.com/443cc2d09097ac98b4affbf8eb8b6f294521c7e6d13d2f6928adca247cab42e8/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f646f6d6578782f617265732f62616467652f6d6173746572)](https://www.codefactor.io/repository/github/domexx/ares/overview/master) [![GitHub license](https://camo.githubusercontent.com/dcfd4525b3e95551691fd645e2123a32a45c957703d551bb36ed0aa0f2a116ed/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4e61657265656e2f5374726170446f776e2e6a732e737667)](https://github.com/Domexx/aresd/blob/master/LICENSE)
=================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#-)

Introduction
------------

[](#introduction)

This project is based on the micro framework slim. It can be used for creating and expanding fast apis.

Base Features:
--------------

[](#base-features)

- Responses
- Exceptions
- Validation
- Authentication
- Locales &amp; Translations
- Cache
- Request Throttle
- Database
- Illuminate QueryBuilder
- Slugs
- Configs
- Dotenv
- Logging
- DI Container
- Routing (Slim)

Installation
------------

[](#installation)

##### 1. Clone / Require project.

[](#1-clone--require-project)

```
$ git clone https://github.com/Domexx/ares.git
or
$ composer require domexx/ares
```

##### 2. Change directory to project.

[](#2-change-directory-to-project)

```
$ cd ares
```

##### 3. Copy dotenv config.

[](#3-copy-dotenv-config)

```
$ cp .env.example .env
```

##### 4. Install composer dependencies.

[](#4-install-composer-dependencies)

```
$ composer install
```

##### 5. Give rights to the folder.

[](#5-give-rights-to-the-folder)

```
$ chmod -R 775 {dir name}
```

Configuration
-------------

[](#configuration)

##### Configure your .env:

[](#configure-your-env)

```
# Database Credentials
DB_HOST=db
DB_PORT=db
DB_NAME="ares"
DB_USER="ares"
DB_PASSWORD="your_password"

# development / production
API_DEBUG="production"

WEB_NAME="Ares"
# Defines the link to your frontend application // For CORS purpose (*) to allow all
WEB_FRONTEND_LINK="*"

# 1 = Enabled, 0 = Disabled
CACHE_ENABLED=1
# "Files" for Filecache, "Predis" for Redis
CACHE_TYPE="Files"
# Defines the cache alive time in seconds
CACHE_TTL=950

# Redis Host
CACHE_REDIS_HOST=127.0.0.1
# Redis Port, standard Port is 6379
CACHE_REDIS_PORT=6379

# Only works with Redis // Enables Throttling // Enables that people only can call the endpoint certain times in a short period
THROTTLE_ENABLED=0

TOKEN_ISSUER="Ares-Issuer"
TOKEN_DURATION=86400

# The secret must be at least 12 characters in length; contain numbers; upper and lowercase letters; and one of the following special characters *&!@%^#$
TOKEN_SECRET="Secret123!456$"

```

Expand project
--------------

[](#expand-project)

### Create custom Module:

[](#create-custom-module)

##### 1. Create controller class which extends BaseController

[](#1-create-controller-class-which-extends-basecontroller)

In the controller class you can define functions that are called by calling a route, which can be defined in the app/routes/routes.php. Auth protected routes can be used with setting middleware 'AuthMiddleware', between route path and route action call.

```
