Code Monkey home page Code Monkey logo

l5-xenforobridge's Introduction

XenforoBridge

Simple to use XenForo bridge library. The goal of this package is to allow developer to easily integrate their existing/new application with XenForo Forum Platfrom. This package is still heavily underdevelopment so use with caution. I have also included a ServiceProvider to use within a Laravel application.

If you would like to see this package in action we are currently using for AstronomyConnect.com - ItemHub Database. This is a Laravel 5 app with Xenforo sitting within the public folder. Templates have been designed and implemented in Xenforo and are being rendered by this bridge instead of using Blade.

Installation

Install the XenforoBridge package with Composer by adding the folowing to your composer.json file.

{
    "require": {
        "urb/xenforobridge": "dev-master"
    }
}

Or by using the composer require command

composer require urb/xenforobridge:dev-master

To install XenforoBridge into Laravel 5 simple add the following service provider to your 'config/app.php' in the 'providers' array:

'providers' => array(
		'XenforoBridge\XenforoBridgeServiceProvider::class',
)

Then publish the config file with

php artisan vendor:publish

This will add the file 'config/xenforobridge.php'. This is where you will place the needed configurations to use the Xenforo Bridge.

Within this config file you will need to supply the full directory path to your XenForo installation and the base url path like the example below

return array(
		'xenforo_directory_path' => '/var/www/html/public/forums',
		'xenforo_base_url_path'  => '//example.com/forums/', //Default '/'
	);

Installing Middleware

To install Middleware you wil need to open up the app\Http\Kernel.php and the following middleware to either global middleware array or the routeMiddleware array.

Here is an example adding to the routeMiddleware array

protected $routeMiddleware = [
		'xen.auth' => 'XenforoBridge\Middleware\XenAuthMiddleware',
		'xen.auth.admin' => 'XenforoBridge\Middleware\XenAuthAdminMiddleware',
	];

You can then use them in your routes like so

Route::get('/example', ['middleware' => 'xen.auth',function(){
	//Do stuff
}]);

or you can use them in your controllers themselves

class SampleController extends Controller {


    function __construct()
    {

        $this->middleware('xen.auth');
    }

}

For more information on Middleware development an installation check out Laravel Docs - Middleware

Credits

Special thanks to VinceG, the idea and much of my work is based on his package xenforo-sdk which was previously integrated within an ongoing project.

l5-xenforobridge's People

Contributors

gabarba avatar matthewsh avatar

Watchers

 avatar  avatar

Forkers

catchup-forks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.