Example #1
0
 public static function laravel_init()
 {
     // Load AutoLoad Aliases
     \Laravel\Autoloader::alias('\\Cloudmanic\\WarChest\\Libraries\\LaravelAuth', 'LaravelAuth');
     \Laravel\Autoloader::alias('\\Cloudmanic\\WarChest\\Libraries\\Me', 'Me');
     // Extend the Laravel Auth library to use our own custom driver.
     \Auth::extend('cloudmanic_auth', function () {
         return new LaravelAuth();
     });
     // Set Api auth filter.
     \Laravel\Routing\Route::filter('api_auth', function () {
         return CloudAuth::sessioninit();
     });
     // Build a micro for activating a class or not. We use this in a main navigation
     // to set the html class to active or not.
     \Laravel\HTML::macro('is_active', function ($name, $home = false, $class = 'active') {
         $base = \Laravel\URI::segment(1);
         // Is the the default route?
         if ($home && empty($base)) {
             return $class;
         }
         // Compare the segment.
         if ($base == $name) {
             return $class;
         }
         return '';
     });
 }
Example #2
0
<?php

\Laravel\Autoloader::namespaces(array('S2' => Bundle::path('plant') . 'classes'));