Vbulletin auth library for Laravel 4 (Illuminate)

v1.1.3 2013-11-26 14:43 UTC


Authentication for VBulletin users in Laravel 4. Tested with VBulletin 4.x.


Add pperon/vbauth as a requirement to composer.json:

    "require": {
        "pperon/vbauth": "1.*"

Update your packages with composer update or install with composer install.

Once Composer has installed or updated your packages you need to register Vbauth with Laravel itself. Open app/config/app.php and find the providers key towards the bottom and add:

'providers' => array(

In order to use shorter class alias add it to alias sections in app/config/app.php:

'aliases' => array(
		'Vbauth'		  => 'Pperon\Vbauth\Facades\Vbauth',


Default configuration file is located in vendor/pperon/vbauth/src/config/config.php but you should overwrite it with app/config/packages/pperon/vbauth/config.php file.


Example usage in a controller:

	// Show administrator page
} elseif (Vbauth::isLoggedin()) {
	// Show user page
} else {
	// Show guest page

###Vbulletin User Variables

You may access user information directly by calling Vbauth::get('fieldname'). Fields are defined in config.php (select_columns).


if(Vbauth::isLoggedin()) {
    $user_id  = Vbauth::get('userid');
    $username = Vbauth::get('username');
    $email    = Vbauth::get('email');


Checks for VBulletin user cookie and returns:

TRUE - user is logged in, FALSE - there is no vbulletin cookie (user not logged in)


Checks whether the user belongs to Admin usergroup. Usually this means the user belongs to usergroup with id = 6 but you can modify this in config.php file by changing admin group ids.

TRUE - user belongs to admin usergroup FALSE - user doesn't belong to admin usergroup


Checks whether the user belongs to specific usergroup. Default available groups: admin, moderator, user, banned, guest. You can add more in config.php.

TRUE - user belongs to specific group


if(Vbauth::is('moderator')) {


Returns URL to logout script in Vbulletin installation.




Returns user data for any choosen forum user


$user_id = 8;
$user = Vbauth::getUserInfo($user_id);
echo $user['email']; // displays email for user with user_id = 8
echo $user['username']; // show username

Change Log


Added support for separate database connection (when vbulletin forum database is located in different database than laravel):

Set the connection in app/config/database.php and add the connection name to config/packages/pperon/vbauth/config.php:

  'db_connection' => 'vbconn', // vbconn is the connection name in database.php


Added getUserInfo() method which returns user information for any forum user


$user_id = 8;
$user = Vbauth::getUserInfo($user_id);
echo $user['email']; // displays email for user with user_id = 8