PHPackages                             mamift/redbean4-laravel5 - 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. [Database &amp; ORM](/categories/database)
4. /
5. mamift/redbean4-laravel5

ActiveLibrary[Database &amp; ORM](/categories/database)

mamift/redbean4-laravel5
========================

A Laravel 5 and Lumen compatible service provider for Redbean 4

276PHP

Since Mar 9Pushed 9y ago2 watchersCompare

[ Source](https://github.com/mamift/redbean4laravel5provider)[ Packagist](https://packagist.org/packages/mamift/redbean4-laravel5)[ RSS](/packages/mamift-redbean4-laravel5/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

redbean4-laravel5
=================

[](#redbean4-laravel5)

### A Laravel 5 and Lumen-compatible service provider package for RedBeanPHP ORM 4.3.

[](#a-laravel-5-and-lumen-compatible-service-provider-package-for-redbeanphp-orm-43)

NOTE: This is not Laravel 4 compatible.

This is a Laravel 5 and Lumen-compatible package to allow the use of [Redbean PHP ORM](http://redbeanphp.com), version 4.3.

### License - GPL2

[](#license---gpl2)

As redbeanPHP is itself licensed under GPL2, so is this package.

Please refer to the [GPL 2 license here](https://www.gnu.org/licenses/gpl-2.0.html).

### Pre-requisites for Lumen

[](#pre-requisites-for-lumen)

In Lumen, you must enable [dotenv](http://lumen.laravel.com/docs/database#configuration) as it is disabled by default in new Lumen installations (uncomment this line inside app.php):

```
Dotenv::load(__DIR__.'/../');

```

Also you must configure a default .env file in both Laravel and Lumen with database connection settings. As a minimum you must have the following settings configured:

```
DB_CONNECTION=
DB_HOST=
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=

DB_CONNECTION determines what type of database you're using (mysql or postresql or whatever)
DB_HOST is the name or IP of the database server
DB_DATABASE is the name of the database
DB_USERNAME is the username used to the connect to the database
DB_PASSWORD is the password for the DB_USERNAME

```

### How to install

[](#how-to-install)

Add this line

```
"mamift/redbean4-laravel5":"dev-master"

```

to your composer.json file. Then run composer update in your Lumen or Laravel app directory.

#### For Lumen

[](#for-lumen)

Add this line:

```
$app->register('Mamift\Redbean4Laravel5\RedbeanProvider');

```

to app.php inside the bootstrap/ folder, so RedBeanPHP is setup using Lumen's database settings.

#### For Laravel 5

[](#for-laravel-5)

Add this line

```
\Mamift\Redbean4Laravel5\RedbeanProvider::class,

```

to the providers array inside config/app.php.

For both Lumen and Laravel, RedBeanPHP will register it's own facade class ("R"), and you can begin using Redbean using the 'R::' prefix.

### Usage

[](#usage)

Read [RedBeanPHP's documentation](http://redbeanphp.com/crud) for a complete overview of what you can do with RedBean. Because this package includes the full rb.php file unmodified, every programmable interface listed on RedBean's API documentation pages should be usable.

An example:

```
$user = R::dispense('user');
$user['description'] = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis";
$user->username = "mamift";
$user->gender = R::enum('gender:male');
R::store($user);

```

### A note on how this package exposes RedBean in Laravel

[](#a-note-on-how-this-package-exposes-redbean-in-laravel)

What this package does is load rb.php for each request. Under the "autoload" JSON object inside composer.json, rb.php is specified as part of the "files" array:

```
{
    "autoload": {
	    "files": [
	        "src/rb.php"
	    ]
	}
}

```

A quote from the [Composer documentation](https://getcomposer.org/doc/04-schema.md#files) says:

> If you want to require certain files explicitly on every request then you can use the 'files' autoloading mechanism. This is useful if your package includes PHP functions that cannot be autoloaded by PHP.

Due to rb.php being loaded on each request, there may be a slight performance penalty incurred.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/037149b9ca3256e0b293244db71ed8286a5285a911c76be56757dce9afd593e2?d=identicon)[mamift](/maintainers/mamift)

---

Top Contributors

[![mamift](https://avatars.githubusercontent.com/u/2508444?v=4)](https://github.com/mamift "mamift (34 commits)")

### Embed Badge

![Health badge](/badges/mamift-redbean4-laravel5/health.svg)

```
[![Health](https://phpackages.com/badges/mamift-redbean4-laravel5/health.svg)](https://phpackages.com/packages/mamift-redbean4-laravel5)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
