Commit 4cb94f2c authored by Nicolas Widart's avatar Nicolas Widart

Add 'Modules/Dashboard/' from commit '26e50695'

git-subtree-dir: Modules/Dashboard
git-subtree-mainline: 2d7310f4
git-subtree-split: 26e50695
parents 2d7310f4 26e50695
<?php namespace Modules\Dashboard\Composers;
class SidebarViewComposer
{
public function compose($view)
{
$view->items->put('dashboard', [
'weight' => 0,
'request' => "*/$view->prefix",
'route' => 'dashboard.index',
'icon-class' => 'fa fa-dashboard',
'title' => 'Dashboard',
]);
}
}
\ No newline at end of file
<?php
return [
];
\ No newline at end of file
<?php
return [
'dashboard' => [
'index'
]
];
\ No newline at end of file
<?php namespace Modules\Dashboard\Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class DashboardDatabaseSeeder extends Seeder {
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
// $this->call("OthersTableSeeder");
}
}
\ No newline at end of file
<?php namespace Modules\Dashboard\Http\Controllers\Admin;
use Illuminate\Support\Facades\View;
use Modules\Core\Http\Controllers\Admin\AdminBaseController;
class DashboardController extends AdminBaseController
{
public function index()
{
return View::make('dashboard::admin.dashboard');
}
}
\ No newline at end of file
<?php
Route::group(['prefix' => LaravelLocalization::setLocale(), 'before' => 'LaravelLocalizationRedirectFilter|auth.admin'], function()
{
Route::group(['prefix' => Config::get('core::core.admin-prefix'), 'namespace' => 'Modules\Dashboard\Http\Controllers'], function()
{
Route::get('/', ['as' => 'dashboard.index', 'uses' => 'Admin\DashboardController@index']);
});
});
<?php namespace Modules\Dashboard\Providers;
use Illuminate\Support\ServiceProvider;
class DashboardServiceProvider extends ServiceProvider {
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return array();
}
}
<?php
return [
'welcome-message' => 'Welcome on your admin dashboard'
];
\ No newline at end of file
<?php
return [
'welcome-message' => 'Bienvenue sur votre dashboard'
];
\ No newline at end of file
@extends('core::layouts.master')
@section('content-header')
<h1>
Dashboard
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
</ol>
@stop
@section('content')
<div class="row">
<div class="col-md-12">
<p>{{ trans('dashboard::dashboard.welcome-message') }}</p>
</div>
</div>
@stop
\ No newline at end of file
<?php
use Cartalyst\Sentinel\Laravel\Facades\Sentinel;
class UrlTest extends TestCase
{
/** @test */
public function testDashboardAccessible()
{
$user = Sentinel::findById(4);
Sentinel::login($user);
$crawler = $this->client->request('GET', '/' . Config::get('core::core.admin-prefix'));
$this->assertTrue($this->client->getResponse()->isOk());
$this->assertCount(1, $crawler->filter('h1:contains("Dashboard")'));
}
}
<?php
View::composer('core::partials.sidebar-nav', 'Modules\Dashboard\Composers\SidebarViewComposer');
\ No newline at end of file
{
"name": "Dashboard",
"alias": "dashboard",
"description": "The module responsible for the admin dashboard page.",
"keywords": [],
"active": 1
}
\ No newline at end of file
<?php
/*
|--------------------------------------------------------------------------
| Register The Module Namespaces
|--------------------------------------------------------------------------
|
| Here is you can register the namespace for this module.
| You may to edit this namespace if you want.
|
*/
View::addNamespace('dashboard', __DIR__ . '/Resources/views/');
Lang::addNamespace('dashboard', __DIR__ . '/Resources/lang/');
Config::addNamespace('dashboard', __DIR__ . '/Config/');
/*
|--------------------------------------------------------------------------
| Require The Routes file.
|--------------------------------------------------------------------------
|
| Next, this module will load filters and routes file.
|
*/
require __DIR__ . '/Http/routes.php';
require __DIR__ . '/composers.php';
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment