/** * Boot the service provider. * @return void */ public function boot() { $this->loadViewsFrom(__DIR__ . '/../resources/views', 'blocks'); $this->loadViewsFrom(blocks_path(), 'block'); $this->mergeConfigFrom(realpath(__DIR__ . '/../config/config.php'), 'module'); $this->publishes([__DIR__ . '/../public' => public_path('code_mirror')], 'public'); pusher('sidebar', 'blocks::sidebar', [], 2); pusher('widgets', 'blocks::block_widget', ['blocks' => \Block::all()]); require __DIR__ . '/routes.php'; require __DIR__ . '/blade.php'; }
public function all() { $blocks = scandir(blocks_path()); $length = count($blocks); $arr = array_slice($blocks, 2, $length); $handledArr = []; foreach ($arr as $el) { if ($el == '.gitignore') { continue; } $temp = explode('.', $el); $handledArr[]['name'] = $temp[0]; } return $handledArr; }