Commit 7ff07b69 authored by Sylvain's avatar Sylvain

Personnalisation du Dashboard

parent 7cbfd052
......@@ -128,7 +128,7 @@ php artisan make:controller DashboardController
Dans le fichier `config/modulus.php`
```php
'namespace_custom' => 'App\\Http\\Controllers',
'dashboard_action' => 'App\\Http\\Controllers\\DashboardController@index',
```
Il ne reste plus qu'à personnaliser la methode `index` du controller fraichement créé pour afficher un nouveau Dashboard.
......
......@@ -4,7 +4,8 @@ namespace Goldenscarab\Modulus\App\Http\Repositories;
use Illuminate\Support\Collection;
interface RepositoryInterface {
interface RepositoryInterface
{
public function all($columns = array('*'));
......
......@@ -65,7 +65,6 @@ class PermissionService
{
// On récupère le role admin pour supprimer les permissions
$role_admin = $this->role_repo->findOrFailBy('name', 'admin');
$role_edit = $this->role_repo->findOrFailBy('name', 'editeur');
// Pour chaque élements du groupe
foreach ($this->types as $type => $human_type) {
......
......@@ -52,7 +52,6 @@ class RouteServiceProvider extends ServiceProvider
// Custom
$router->prefix(trim(AUTH_HOME, '/'))
->middleware(['web'])
->namespace(config('modulus.namespace_custom'))
->group(function($router) {
require __DIR__.'/../../routes/custom.php';
});
......
......@@ -27,9 +27,9 @@ return [
'url_prefix' => '/backend',
/**
* Namespace des constroleurs à surcharger
* default: Goldenscarab\\Modulus\\App\\Http\\Controllers
* - DashboardController
* Route vers le controleur Dashboad pour personnalisation
* default: Goldenscarab\\Modulus\\App\\Http\\Controllers\\App\\DashboardController@index
* exemple : App\\Http\\Controllers\\DashboardController@index
*/
'namespace_custom' => 'Goldenscarab\\Modulus\\App\\Http\\Controllers\\App',
'dashboard_action' => 'Goldenscarab\\Modulus\\App\\Http\\Controllers\\App\\DashboardController@index',
];
......@@ -2,5 +2,13 @@
use Illuminate\Support\Facades\Route;
// Dashboard
Route::get('/', 'DashboardController@index')->name('modulus.dashboard');
Route::group(
[
'middleware' => ['auth', 'auth.active', 'role:admin|client'],
'as' => 'modulus.'
], function ($router) {
// Dashboard
Route::get('/', config('modulus.dashboard_action'))->name('dashboard');
});
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