/**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::create('permission_role', function (Blueprint $table) {
         $table->increments('id');
         $table->integer('permission_id');
         $table->integer('role_id');
         $table->timestamps();
     });
     foreach (Laralum::permissions() as $perm) {
         $rel = new Permission_Role();
         $rel->permission_id = \Laralum::permission('id', $perm->id)->id;
         $rel->role_id = \Laralum::role('name', env('ADMINISTRATOR_ROLE_NAME', 'Administrator'))->id;
         $rel->save();
     }
 }
Esempio n. 2
0
<?php

// Operations here
require 'WidgetsOperations.php';
// Widgets here
$widgets = ['latest_users_graph' => Laralum::lineChart($latest_users_graph['title'], $latest_users_graph['element_label'], $latest_users_graph['labels'], $latest_users_graph['data']), 'latest_posts_graph' => Laralum::lineChart($latest_posts_graph['title'], $latest_posts_graph['element_label'], $latest_posts_graph['labels'], $latest_posts_graph['data']), 'users_country_pie_graph' => Laralum::pieChart($users_country_pie_graph['title'], $users_country_pie_graph['labels'], $users_country_pie_graph['data']), 'users_country_geo_graph' => Laralum::geoChart($users_country_geo_graph['title'], $users_country_geo_graph['element_label'], $users_country_geo_graph['data']), 'roles_users' => Laralum::barChart($roles_users['title'], $roles_users['element_label'], $roles_users['labels'], $roles_users['data']), 'basic_stats_1' => "\n        <div class='ui doubling stackable three column grid container'>\n            <div class='column'>\n                <center>\n                    <div class='ui statistic'>\n                        <div class='value'>\n                            " . count(Laralum::users()) . "\n                        </div>\n                        <div class='label'>\n                            " . trans('laralum.users') . "\n                        </div>\n                    </div>\n                </center>\n            </div>\n            <div class='column'>\n                <center>\n                    <div class='ui statistic'>\n                        <div class='value'>\n                            " . count(Laralum::roles()) . "\n                        </div>\n                        <div class='label'>\n                            " . trans('laralum.roles') . "\n                        </div>\n                    </div>\n                </center>\n            </div>\n            <div class='column'>\n                <center>\n                    <div class='ui statistic'>\n                        <div class='value'>\n                            " . count(Laralum::permissions()) . "\n                        </div>\n                        <div class='label'>\n                            " . trans('laralum.permissions') . "\n                        </div>\n                    </div>\n                </center>\n            </div>\n        </div>\n    ", 'basic_stats_2' => "\n        <div class='ui doubling stackable three column grid container'>\n            <div class='column'>\n                <center>\n                    <div class='ui statistic'>\n                        <div class='value'>\n                            " . count(Laralum::posts()) . "\n                        </div>\n                        <div class='label'>\n                            " . trans('laralum.posts') . "\n                        </div>\n                    </div>\n                </center>\n            </div>\n            <div class='column'>\n                <center>\n                    <div class='ui statistic'>\n                        <div class='value'>\n                            " . count(Laralum::postViews()) . "\n                        </div>\n                        <div class='label'>\n                            " . trans('laralum.post_views') . "\n                        </div>\n                    </div>\n                </center>\n            </div>\n            <div class='column'>\n                <center>\n                    <div class='ui statistic'>\n                        <div class='value'>\n                            " . count(Laralum::comments()) . "\n                        </div>\n                        <div class='label'>\n                            " . trans('laralum.comments') . "\n                        </div>\n                    </div>\n                </center>\n            </div>\n        </div>\n    "];