<?php
#namespace KraftHaus\BauhausUser;
/**
* This file is part of the KraftHaus BauhausUser package.
*
* (c) KraftHaus <hello@krafthaus.nl>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use KraftHaus\Bauhaus\Admin;
/**
* Class PermissionAdmin
* @package KraftHaus\BauhausUser
*/
class PermissionAdmin extends KraftHaus\BauhausUser\PermissionAdmin
{
/**
* Public constructor override to set translatable names (singular, plural).
*
* @access public
* @return void
*/
public function __construct()
{
Debugbar::info('own Permission admin - from modules');
parent::__construct();
}
/**
* Configure the PermissionAdmin list.
*
* @param \KraftHaus\Bauhaus\Mapper\ListMapper $mapper
*
* @access public
* @return void
*/
public function configureList($mapper) {
$mapper->identifier('group')
->label(trans('bauhaususer::admin.permissions.list.group'));
parent::configureList($mapper);
}
/**
* Configure the UserAdmin form.
*
* @param \KraftHaus\Bauhaus\Mapper\FormMapper $mapper
*
* @access public
* @return void
*/
public function configureForm($mapper) {
$mapper->text('group')
->label(trans('bauhaususer::admin.permissions.form.group.label'))
->placeholder(trans('bauhaususer::admin.permissions.form.group.placeholder'));
parent::configureForm($mapper);
}
/**
* Configure the PermissionAdmin filters.
* @param \KraftHaus\Bauhaus\Mapper\FilterMapper $mapper
*
* @access public
* @return void
*/
public function configureFilters($mapper) {
$mapper->text('group')
->label(trans('bauhaususer::admin.permissions.filter.group'));
parent::configureFilters($mapper);
}
}
Permission.php
<?php
/**
* Class Permission
* @package KraftHaus\BauhausUser
*/
class Permission extends KraftHaus\BauhausUser\Permission
{
function __construct() {
parent::__construct();
}
}
2014_10_05_132835_add_permission_group.php
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddPermissionGroup extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('permissions', function($table) {
$table->string('group');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('permissions', function($table) {
$table->dropColumn('group');
});
}
}
menu.php (in this file, I store the addMenu() function - can be executed whereever you want)
Hi,
I have extended the bauhaususer and would now use my own admin classes in the backend. I'm using also laravel-modules (which work very well.. anyway).
By default, the bauhaususer packages has a config file, where the menu entries
are defined.
My structure is the following:
The PermissionAdmin.php
Permission.php
2014_10_05_132835_add_permission_group.php
menu.php (in this file, I store the addMenu() function - can be executed whereever you want)
The Result in HTML is:
My problem is now, that i can't overwrite the existing records, because the menu builder will add the entries from the addMenu() into an array.
What I need, is the following:
Any idea?
Thanks!