2015-03-30 16:17:04 +10:30
|
|
|
<?php namespace Flarum\Forum;
|
2015-02-24 20:33:18 +10:30
|
|
|
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
2015-03-30 16:17:04 +10:30
|
|
|
use Flarum\Support\AssetManager;
|
2015-02-24 20:33:18 +10:30
|
|
|
|
2015-03-30 16:17:04 +10:30
|
|
|
class ForumServiceProvider extends ServiceProvider
|
2015-02-24 20:33:18 +10:30
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Bootstrap the application events.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function boot()
|
|
|
|
{
|
2015-03-29 22:13:26 +10:30
|
|
|
$root = __DIR__.'/../..';
|
|
|
|
|
2015-03-30 16:17:04 +10:30
|
|
|
$this->loadViewsFrom($root.'/views', 'flarum.forum');
|
2015-02-24 20:33:18 +10:30
|
|
|
|
|
|
|
$this->publishes([
|
2015-05-06 12:12:22 +09:30
|
|
|
$root.'/public/fonts' => public_path('assets/fonts')
|
2015-02-24 20:33:18 +10:30
|
|
|
]);
|
2015-03-29 22:13:26 +10:30
|
|
|
|
|
|
|
include __DIR__.'/routes.php';
|
2015-02-24 20:33:18 +10:30
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register the service provider.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function register()
|
|
|
|
{
|
2015-03-30 16:17:04 +10:30
|
|
|
$this->app['flarum.forum.assetManager'] = $this->app->share(function ($app) {
|
2015-04-25 22:34:26 +09:30
|
|
|
return new AssetManager($app['files'], $app['path.public'].'/assets', 'forum');
|
2015-02-24 20:33:18 +10:30
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|