public function run()
 {
     // disable mysql foreigh key check
     if (config('database.default') == 'mysql') {
         DB::statement('SET FOREIGN_KEY_CHECKS=0;');
     }
     /**
      * Setup config
      */
     // Model
     $model = '\\App\\Role';
     // Table
     $table = 'permission_role';
     /**
      * TODO: Need to setup a config to enable and disable truncate
      */
     // truncate Role table
     if (config('database.default') == 'mysql') {
         DB::table($table)->truncate();
     }
     /**
      *
      * Attach Role - User
      *
      * --------------------------------------
      */
     // 1
     App\Role::findOrFail(1)->permissions()->attach(1);
     App\Role::findOrFail(1)->permissions()->attach(2);
     App\Role::findOrFail(1)->permissions()->attach(3);
     // 2
     App\Role::findOrFail(2)->permissions()->attach(2);
     /**
      *
      * END - Insert Data
      *
      * --------------------------------------
      * --------------------------------------
      */
     // enable mysql foreigh key check
     if (config('database.default') == 'mysql') {
         DB::statement('SET FOREIGN_KEY_CHECKS=1;');
     }
 }
예제 #2
0
*/
/*Route::controllers([
	'auth' => 'Auth\AuthController',
	'password' => 'Auth\PasswordController',
]);*/
Route::bind('videos', function ($value, $route) {
    return App\Video::whereSlug($value)->first();
});
/*//Admin routes
Route::get('admin/index', function() {
  return View::make('admin');
});*/
//Route::controller('admin/index', 'AdminController');
/* Roles Routes
Route::get('/roles', 'RolesController@index');
Route::get('/roles/create', 'RolesController@create');
Route::get('/roles/{id}', 'RolesController@show');
Route::post('roles', 'RolesController@store');
*/
Route::resource('roles', 'RolesController');
Route::bind('roles', function ($value, $route) {
    return App\Role::findOrFail($value);
});
// added by buddha for dynamic dropdown - start
// Route::get('api/dropdown', function(){
//   $input = Input::get('class');
//
// 	$res = "Introduction";
// 	return Response::$res;
// });
// added by buddha for dynamic dropdown - end