PHPackages                             owlgrin/hive - 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. [Framework](/categories/framework)
4. /
5. owlgrin/hive

ActiveLibrary[Framework](/categories/framework)

owlgrin/hive
============

THe foundation for Laravel projects

61.3k3[9 issues](https://github.com/owlgrin/hive/issues)PHP

Since Mar 16Pushed 10y ago2 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Hive
====

[](#hive)

Basic Foundation for Laravel apps.

The package includes the following other packages to get started with the development as quickly as possible.

- [Dingo API](https://github.com/dingo/api)
- [Laravel OAuth 2.0 Server Wrapper](https://github.com/lucadegasperi/oauth2-server-laravel)

Dingo API already depends upon the [Fractal](https://github.com/thephpleague/fractal), so transformations come out of the box.

Hive works with Laravel 4.2 as well as Laravel 5.

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

[](#installation)

You will need to require it in your `composer.json` file.

`"owlgrin/hive": "dev-master"`

And then, you will need to add the following service providers in your `app.php`.

```
'Dingo\Api\ApiServiceProvider',
'LucaDegasperi\OAuth2Server\OAuth2ServerServiceProvider',
'Owlgrin\Hive\HiveServiceProvider',
```

Validation
----------

[](#validation)

Hive comes with a custom validator with some extended features, which you can use instead of the Laravel's inbuilt one. (Custom Validator extends the Laravel's Validator, so you get everything that it has to offer.)

#### How to use custom validator

[](#how-to-use-custom-validator)

You will need to resolve it when the Validator is required. To do so, you can add the following code in any file that is autoloaded (eg. in `global.php`).

```
Validator::resolver(function($translator, $data, $rules, $messages)
{
    return new Owlgrin\Hive\Validation\Validator($translator, $data, $rules, $messages);
});
```

#### How to use the validation

[](#how-to-use-the-validation)

You will need to create a file, say `UserValidator.php`, which extends `Owlgrin\Hive\Validation\Runner`. Then, you can create various properties that hold the rules for various situations.

```
