PHPackages                             themonkeys/laravel-silverstripe - 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. themonkeys/laravel-silverstripe

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

themonkeys/laravel-silverstripe
===============================

Integrates the Silverstripe CMS into your Laravel application

1.1(12y ago)30171[3 issues](https://github.com/TheMonkeys/laravel-silverstripe/issues)MITPHPPHP &gt;=5.3.0

Since Aug 22Pushed 12y ago8 watchersCompare

[ Source](https://github.com/TheMonkeys/laravel-silverstripe)[ Packagist](https://packagist.org/packages/themonkeys/laravel-silverstripe)[ Docs](http://github.com/TheMonkeys/laravel-silverstripe)[ RSS](/packages/themonkeys-laravel-silverstripe/feed)WikiDiscussions master Synced 3w ago

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

[![The Monkeys](https://camo.githubusercontent.com/580df7170b07322a64b603ab110484f004b2464ccf1a56e9fc2b3dad16b39378/687474703a2f2f7777772e7468656d6f6e6b6579732e636f6d2e61752f696d672f6d6f6e6b65795f6c6f676f2e706e67)](https://camo.githubusercontent.com/580df7170b07322a64b603ab110484f004b2464ccf1a56e9fc2b3dad16b39378/687474703a2f2f7777772e7468656d6f6e6b6579732e636f6d2e61752f696d672f6d6f6e6b65795f6c6f676f2e706e67)

Silverstripe Adapter for Laravel
================================

[](#silverstripe-adapter-for-laravel)

We wanted to use the fantastic Silverstripe CMS but still keep the brilliant application development framework provided by Laravel, so we found a way to have both.

This package provides:

- a thin layer to access Silverstripe model objects from within your Laravel code
- a new kind of route that enables page URLs defined in the Silverstripe CMS to be handled by Laravel routes
- automatic configuration of Silverstripe's database settings based on your Laravel configuration
- automatic coupling of Silverstripe's log system through to Laravel's log system

Requirements
------------

[](#requirements)

- **Laravel 4.1.x**: If you need to use Laravel 4.0.x, you will need to use v1.0 of this package. The current release only works on Laravel 4.1.x.

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

[](#installation)

### Install the package

[](#install-the-package)

To get the latest version of the package simply require it in your composer.json file by running:

```
composer require themonkeys/laravel-silverstripe:dev-master --no-update
composer update themonkeys/laravel-silverstripe
```

Once installed, you need to register the service provider with the application. Open up `app/config/app.php` and find the `providers` key.

```
'providers' => array(
    'Themonkeys\Silverstripe\SilverstripeRoutingServiceProvider',
)
```

The package provides a facade through which you may access some common CMS functionality. To make it easier to use, you can add it to the aliases in your `app/config/app.php` file too:

```
'aliases' => array(
    'CMS' => 'Themonkeys\Silverstripe\Silverstripe',
)
```

Sadly, there are some classnames in Silverstripe that conflict with the aliases defined in Laravel's default `app.php`config (thankfully Laravel uses namespaces so we're not entirely screwed). The best solution we've come up with so far requires you to do some work... rename the following aliases in your `app/config/app.php` file, and stick to using the new aliases where necessary in the rest of your work:

```
'aliases' => array(
    'L_Config'       => 'Illuminate\Support\Facades\Config',
    'L_Controller'   => 'Illuminate\Routing\Controllers\Controller',
    'L_Cookie'       => 'Illuminate\Support\Facades\Cookie',
    'L_File'         => 'Illuminate\Support\Facades\File',
    'L_Form'         => 'Illuminate\Support\Facades\Form',
    'L_Session'      => 'Illuminate\Support\Facades\Session',
    'L_Validator'    => 'Illuminate\Support\Facades\Validator',
)
```

You don't have to use `L_`, you can use whatever you like.

Everywhere except blade templates, we prefer to use `use` statements and then we can continue to use the normal Laravel names. For example, say you have a controller that needs to use Laravel's `Validator`. Code it like this:

```
