/**
  * run
  *
  * @access public
  * @return void
  */
 public function run()
 {
     parent::run();
     $routes = Route::getRoutes();
     $children = [];
     foreach ($routes as $route) {
         list($controller, $action) = explode('@', $route->getActionName());
         $parent = Resource::firstOrCreate(['name' => $controller]);
         $child = ['name' => $route->getName(), 'action' => $action, 'url' => $route->getPath(), 'parent_id' => $parent->id];
         $children[] = $child;
     }
     DB::table('resources')->insert($children);
 }
Esempio n. 2
0
/**
 * Create custom wp database for storing testimonials
 */
function install_db()
{
    Data::setDatabase();
    Seeder::run();
}