PHPackages                             danjme/bridgevb - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. danjme/bridgevb

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

danjme/bridgevb
===============

Laravel 4 and vBulletin 4 bridge for authentication services.

1.1.1(12y ago)043MITPHPPHP &gt;=5.3.0

Since Jun 1Pushed 9y ago1 watchersCompare

[ Source](https://github.com/danjme/bridgevb)[ Packagist](https://packagist.org/packages/danjme/bridgevb)[ Docs](https://github.com/ELD/bridgevb)[ RSS](/packages/danjme-bridgevb/feed)WikiDiscussions master Synced 1mo ago

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

vBulletin 4 bridge for Laravel 4
================================

[](#vbulletin-4-bridge-for-laravel-4)

### This is a Laravel Composer package providing a method to authenticate against a [vBulletin 4.x](http://www.vbulletin.com) database to allow for [Laravel 4](http://laravel.com) sites to be built beside a vBulletin forum without requiring users to create new accounts.

[](#this-is-a-laravel-composer-package-providing-a-method-to-authenticate-against-a-vbulletin-4x-database-to-allow-for-laravel-4-sites-to-be-built-beside-a-vbulletin-forum-without-requiring-users-to-create-new-accounts)

This package is based off of the pperon/vbauth package and the vb\_auth package for CodeIgnitor.

Add `eld/bridgevb` as a requirement in composer.json:

```
{
	"require": {
		"eld/bridgevb": "1.*"
	}
}
```

Run `composer update` to update your packages or `composer install` if you haven't already run the command

To use the package, add this line to your providers array contained in the app/config/app.php file:

```
'providers' => array(
				...
				...
				'Eld\Bridgevb\BridgevbServiceProvider',
),
```

In order to use the facade, add the following to your aliases array in app/config/app.php:

```
'aliases' => array(
				...
				...
				'Bridgevb'		  => 'Eld\Bridgevb\Facades\BridgeVb',
),
```

Configuration File:
===================

[](#configuration-file)

The default configuration file is found in `vender/eld/bridgevb/src/config/config.php` but you should overwrite it with a `app/config/packages/eld/bridgevb/config.php` file.

The configuration file looks like:

```
array(
	'connection' => 'mysql',
	'cookie_hash' => 'AdflkjEr90234asdlkj1349SDFkl',
	'cookie_prefix' => 'bb_',
	'db_prefix' => 'vb_',
	'forum_path' => 'http://example.com/',
	'user_groups' => array(
		'Admin' => array(6),
		'Moderator' => array(7),
		'Super Moderator' => array(5),
		'User' => array(2),
		'Banned' => array(8),
		'Guest' => array(3),
	),
	'user_columns' => array(
		'userid',
		'username',
		'password',
		'usergroupid',
		'membergroupids',
		'email',
		'salt'
	),
);
```

You need to replace the following fields in the existing config file or the config file in `app/config/packages/eld/bridgevb/config.php` file to suit your setup: `connection`, `cookie_hash`, `cookie_prefix`, `db_prefix`, `db_prefix`, `forum_path`, and add your forum's user groups in the `user_groups` portion and customize which user info you'd like to fetch with the `user_columns` option.

Exampe Usage:
=============

[](#exampe-usage)

This is what a filter could look like in `app/filters.php` if you were to authenticate users on every page they loaded.

```
Route::filter('vbauth', function()
{
	if (!Bridgevb::isLoggedIn()) return Redirect::to('login');
});
```

If you wanted to log in users externally from the vBulletin site, here's an snippet of how you'd do it:

```
Route::post('/login', function()
{
	$creds = array(
		'username' => Input::get('username'),
		'password' => Input::get('password'),
		'remember_me' => Input::get('remember_me', false),
	);

	if (Bridgevb::attempt($creds))
		return Redirect::to('/');
	else
		return Redirect::to('/login');
});
```

### The following are functions included in the library:

[](#the-following-are-functions-included-in-the-library)

Examples of usage are included in each description of the method

#### is()

[](#is)

The is() function takes in a string parameter an returns whether the user is a member of that user group.

```
Route::get('/isgroup', function()
{
	return (Bridgevb::is('Banned') ? 'You are banned' : 'You are not banned');
});
```

#### attempt()

[](#attempt)

The attempt method takes in an array of credentials and returns true if the authentication attempt was successful and returns false if the credentials were incorrect.

```
Route::post('/login', function()
{
	$creds = array(
		'username' => Input::get('username'),
		'password' => Input::get('password'),
		'remember_me' => Input::get('remember_me', false),
	);

	if (Bridgevb::attempt($creds))
		return Redirect::to('/');
	else
		return Redirect::to('/login');
});
```

#### isLoggedIn()

[](#isloggedin)

The isLoggedIn() function checks to authenticate the current user and retursn a non-zero value if the user is currently authenticated.

```
Route::get('/login', function()
{
	if(Bridgevb::isLoggedIn())
		return Redirect::to('/');
	return View::make('login');
});
```

#### getUserInfo()

[](#getuserinfo)

The getUserInfo() function returns a stdClass object representing the user data retrieved from the vBulletin user table as specified in the configuration file.

```
$user = Bridgevb::getUserInfo();
echo 'Hello, ' . $user->username;
```

#### get()

[](#get)

The get method takes in a string and returns the particular piece of information about the user that's passed in.

```
$username = Bridgevb::get('username');
echo 'Hello, ' . $username;
```

#### getLogoutHash()

[](#getlogouthash)

This function returns the logout hash for the user logged in that allows for you to link to vBulletin's logout function with teh proper logout hash.

```
return 'Logout';
```

#### logout()

[](#logout)

Logs the user out manually instead of routing through vBulletin's logout function.

```
Bridgevb::logout();
```

Changelog
=========

[](#changelog)

6/1/2013 (v1.0) - Initial Release
6/2/2013 (v1.0.1) - Revised code to be PSR-2 compliant
6/3/2013 (v1.1) - Patched bug causing multiple rows to be added to the database when the session was being authenticated
6/3/2013 (v1.1.1) - Fixed session creation bugs

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 71.1% 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.

###  Release Activity

Cadence

Every ~1 days

Total

4

Last Release

4722d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3031dcb1de3e3b5d3864ca1377eb9cce8615eb66362d4d381978d59aa211ef63?d=identicon)[danjme](/maintainers/danjme)

---

Top Contributors

[![ELD](https://avatars.githubusercontent.com/u/650044?v=4)](https://github.com/ELD "ELD (27 commits)")[![danjme](https://avatars.githubusercontent.com/u/570150?v=4)](https://github.com/danjme "danjme (11 commits)")

---

Tags

laravelauthL4vbulletinvb

### Embed Badge

![Health badge](/badges/danjme-bridgevb/health.svg)

```
[![Health](https://phpackages.com/badges/danjme-bridgevb/health.svg)](https://phpackages.com/packages/danjme-bridgevb)
```

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M344](/packages/tymon-jwt-auth)[php-open-source-saver/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

8359.8M52](/packages/php-open-source-saver-jwt-auth)[codegreencreative/laravel-samlidp

Make your PHP Laravel application an Identification Provider using SAML 2.0. This package allows you to implement your own Identification Provider (idP) using the SAML 2.0 standard to be used with supporting SAML 2.0 Service Providers (SP).

263763.5k1](/packages/codegreencreative-laravel-samlidp)[jurager/teams

Laravel package to manage team functionality and operate with user permissions.

22817.3k](/packages/jurager-teams)[codebot/entrust

This package provides a flexible way to add Role-based Permissions to Laravel

1596.6k](/packages/codebot-entrust)[setiawanhu/sanctum-auth

Laravel package for generating user authentication feature using Laravel Sanctum

132.8k](/packages/setiawanhu-sanctum-auth)

PHPackages © 2026

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