private function generateFolder($data, $moduleName, $path, $filepath = null) { foreach ($data as $basefolder => $subfolders) { $generateFolder = app_path() . '/Modules/' . $moduleName . '/' . $path . '/' . $basefolder . '/ '; $this->makeDirectory($generateFolder); $this->warn("+ Directory Generated:\t" . $generateFolder); $mPath = app_path() . '/Modules/' . $moduleName . '/'; if ($this->optionalStubPath != "") { //$stubPath = __DIR__.'/stubs/'.$path.$basefolder; //$stubPathDirectory = __DIR__.'/stubs/'; $stubPath = resource_path("stubs/" . $this->optionalStubPath . '/stubs/' . $path . $basefolder); $stubPathDirectory = resource_path("stubs/" . $this->optionalStubPath . '/stubs/'); } else { $stubPath = __DIR__ . '/stubs/' . $path . $basefolder; $stubPathDirectory = __DIR__ . '/stubs/'; } // Module Files foreach ((array) $this->findFiles($stubPathDirectory) as $file) { $this->generateFile($file, $moduleName, $mPath, $stubPathDirectory); } // Module Directory Files foreach ((array) $this->findFiles($stubPath) as $file) { $this->generateFile($file, $moduleName, $generateFolder, $stubPath); } // Module Directory Folders (loop) if (isset($subfolders)) { $this->generateFolder($subfolders, $this->moduleName, $path . '/' . $basefolder . '/'); } } }
/** * Bootstrap the application services. */ public function boot(Router $router, ViewFactory $view) { $view->addNamespace('admin', resource_path('views/admin')); // route model binding for admin routes $router->model('content_page', Page::class); $this->bootAdminRoutes($router); }
/** * Bootstrap any application services. * * @return void */ public function boot() { $this->loadViewsFrom(__DIR__ . '/resources/views', 'pagination'); if ($this->app->runningInConsole()) { $this->publishes([__DIR__ . '/resources/views' => resource_path('views/vendor/pagination')], 'laravel-pagination'); } }
function larapackage($package, $alias = null) { if (!$alias) { $alias = $package; } //если назначена кастомная тема оформления if ($theme = PageTheme::getCurrent()) { /// если переопределены шаблоны вьюх для указанной темы $theme_views_dir = base_path('vendor/' . $package . '/src/views/!/themes/' . $theme); if (file_exists($theme_views_dir)) { $this->loadViewsFrom($theme_views_dir, $alias); } } //базовые шаблоны пакета $view_dir = base_path('vendor/' . $package . '/src/views'); if (file_exists($view_dir)) { $this->loadViewsFrom($view_dir, $alias); } //базовые шаблоны пакета $lang_dir = base_path('vendor/' . $package . '/src/lang'); if (file_exists($lang_dir)) { $this->loadTranslationsFrom($lang_dir, $alias); $this->publishes([$lang_dir => resource_path('lang/vendor/' . $alias)]); } //регистрируем миграции if (is_dir(base_path('vendor/' . $package . '/src/migrations'))) { $this->publishes([base_path('vendor/' . $package . '/src/migrations') => base_path('database/migrations')], 'migrations'); } $this->bootPackage($package); }
function layout_version($layout = 'main') { $get_hash = function ($layout) { $hash = ''; $files = [public_path('assets/css/app.css'), public_path('assets/js/app.js'), resource_path('views/layouts/main.blade.php'), resource_path('views/partials/header.blade.php'), resource_path('views/partials/footer.blade.php')]; if ($layout != 'main') { $files[] = resource_path('views/layouts/' . str_replace('.', DIRECTORY_SEPARATOR, $layout) . '.blade.php'); } foreach ($files as $file) { $hash .= hash_file('md5', $file); } return hash('md5', $hash); }; if (App::environment('local', 'development', 'staging')) { if (!($hash = config('version.layout.' . $layout))) { $hash = $get_hash($layout); config(compact('hash')); } } else { $hash = Cache::remember('version.layout.' . $layout, config('version.cache_duration', 5), function () use($get_hash, $layout) { return $get_hash($layout); }); } return $hash; }
/** * Perform post-registration booting of services. * * @return void */ public function boot(Router $router) { $router->middleware('roles', \App\Http\Middleware\HasRole::class); $router->middleware('admin', \App\Http\Middleware\AdminMiddleware::class); if (!$this->app->routesAreCached()) { require __DIR__ . '/Http/routes.php'; } $configFiles = ['acl']; foreach ($configFiles as $config) { $this->mergeConfigFrom(__DIR__ . "/config/{$config}.php", 'acl'); } $this->loadTranslationsFrom(__DIR__ . '/resources/lang', 'acl'); $this->loadViewsFrom(__DIR__ . '/resources/views', 'acl'); //Publish middleware $this->publishes([__DIR__ . '/Middleware/' => app_path('Http/Middleware')]); //Publish providers $this->publishes([__DIR__ . '/Providers/' => app_path('Providers')]); //Publish views $this->publishes([__DIR__ . '/resources/views' => resource_path('views')], 'views'); //Publish translations $this->publishes([__DIR__ . '/resources/lang/' => resource_path('lang/')], 'translations'); // Publish a config file $this->publishes([__DIR__ . '/config/acl.php' => config_path('acl.php')], 'config'); //Publish migrations $this->publishes([__DIR__ . '/database/migrations' => database_path('migrations'), __DIR__ . '/database/seeds' => database_path('seeds')], 'migrations'); $this->publishes([__DIR__ . '/assets/bower_components/AdminLTE/' => public_path('/assets/bower_components/AdminLTE/')], 'public'); $this->publishes([__DIR__ . '/Http/Controllers/Auth/' => app_path('/Http/Controllers/Auth/'), __DIR__ . '/Http/Controllers/Admin/' => app_path('/Http/Controllers/Admin/')], 'controllers'); $this->publishes([__DIR__ . '/Models/Admin/' => app_path()], 'models'); }
public function register() { $this->publishes([__DIR__ . '/../database/seeds/' => database_path('seeds')], 'seeds'); $this->publishes([__DIR__ . '/../database/migrations/' => database_path('migrations')], 'migrations'); $this->publishes([__DIR__ . '/../app/' => app_path()], 'app'); $this->publishes([__DIR__ . '/../resources/views/' => resource_path('views')], 'views'); }
/** * Perform post-registration booting of services. * * @return void */ public function boot() { if (!$this->app->routesAreCached()) { require __DIR__ . '/Http/routes.php'; } $configFiles = ['job']; foreach ($configFiles as $config) { $this->mergeConfigFrom(__DIR__ . "/config/{$config}.php", 'job_market_manager'); } $this->loadTranslationsFrom(__DIR__ . '/resources/lang', 'job_market_manager'); $this->loadViewsFrom(__DIR__ . '/resources/views', 'job_market_manager'); //Publish middleware // $this->publishes([ // __DIR__ . '/Middleware/' => app_path('Http/Middleware'), // ]); //Publish providers // $this->publishes([ // __DIR__ . '/Providers/' => app_path('Providers'), // ]); //Publish views $this->publishes([__DIR__ . '/resources/views' => resource_path('views')], 'views'); //Publish translations $this->publishes([__DIR__ . '/resources/lang/' => resource_path('lang/')], 'translations'); // Publish a config file $this->publishes([__DIR__ . '/config/job.php' => config_path('job.php')], 'config'); //Publish migrations $this->publishes([__DIR__ . '/database/migrations' => database_path('migrations')], 'migrations'); // $this->publishes([ // __DIR__.'/assets/bower_components/AdminLTE/' => public_path('/assets/bower_components/AdminLTE/'), // ], 'public'); $this->publishes([__DIR__ . '/Http/Controllers/Admin/' => app_path('/Http/Controllers/Admin/')], 'controllers'); $this->publishes([__DIR__ . '/Models/Admin/' => app_path()], 'models'); }
/** * Bootstrap any application services. * * @return void */ public function boot() { $this->publishes([__DIR__ . '/../config/shows.php/' => config_path('shows.php')], 'config'); $this->publishes([__DIR__ . '/../database/migrations/' => database_path('migrations')], 'migrations'); $this->loadViewsFrom(__DIR__ . '/../resources/views', 'shows'); $this->publishes([__DIR__ . '/../resources/views' => resource_path('views/vendor/shows')]); }
/** * Bootstrap the application services. * * @return void */ public function boot() { $this->loadViewsFrom($this->getViewsPath(), 'flash'); $this->publishes([$this->getViewsPath() => resource_path('views/vendor/flash')]); $this->publishes([$this->getSassPath() => resource_path('/assets/sass/vendor')]); $this->publishes([$this->getJavascriptPath() => resource_path('/assets/js/components')]); }
/** * Perform post-registration booting of services. * * @return void */ public function boot() { if (!$this->app->routesAreCached()) { require __DIR__ . '/routes.php'; } $this->app->make('designpond\\newsletter\\Http\\Controllers\\Frontend\\NewsletterController'); $this->app->make('designpond\\newsletter\\Http\\Controllers\\Frontend\\InscriptionController'); $this->app->make('designpond\\newsletter\\Http\\Controllers\\Backend\\NewsletterController'); $this->app->make('designpond\\newsletter\\Http\\Controllers\\Backend\\CampagneController'); $this->app->make('designpond\\newsletter\\Http\\Controllers\\Backend\\ContentController'); $this->app->make('designpond\\newsletter\\Http\\Controllers\\Backend\\SendController'); $this->app->make('designpond\\newsletter\\Http\\Controllers\\Backend\\SubscriberController'); $this->app->make('designpond\\newsletter\\Http\\Controllers\\Backend\\ImportController'); $this->app->make('designpond\\newsletter\\Http\\Controllers\\Backend\\ListController'); $this->app->make('designpond\\newsletter\\Http\\Controllers\\Backend\\EmailController'); $this->app->make('designpond\\newsletter\\Http\\Controllers\\Backend\\ClipboardController'); $this->publishes([__DIR__ . '/database/migrations/' => database_path('migrations')], 'migrations'); $this->publishes([__DIR__ . '/database/seeds' => base_path('database/seeds')], 'seeds'); $this->publishes([__DIR__ . '/config/newsletter.php' => config_path('newsletter.php')], 'config'); $this->publishes([__DIR__ . '/assets' => public_path('newsletter')], 'assets'); $this->loadViewsFrom(__DIR__ . '/views', 'newsletter'); $this->publishes([__DIR__ . '/views' => resource_path('views/vendor/newsletter')], 'views'); $this->publishes([__DIR__ . '/views/Backend/layouts' => resource_path('views/vendor/newsletter/Backend/layouts')], 'layouts'); $this->app['validator']->extend('emailconfirmed', function ($attribute, $value, $parameters) { $email = \DB::table('newsletter_users')->where('email', '=', $value)->first(); if ($email) { return !$email->activated_at ? false : true; } return false; }); }
/** * {@inheritdoc} */ public function boot() { // The assets path. $assets = __DIR__ . '/../resources/assets/'; // The views path. $views = __DIR__ . '/../resources/views/'; // The controllers path. $controllers = __DIR__ . '/Http/Controllers/'; // The presenters path. $presenters = __DIR__ . '/Http/Presenters/'; // The requests path. $requests = __DIR__ . '/Http/Requests/'; // The middleware path. $middleware = __DIR__ . '/Http/Middleware/'; // The administration routes file. $routes = __DIR__ . '/Http/administration.php'; // The models path. $models = __DIR__ . '/Models/'; // The exceptions path. $exceptions = __DIR__ . '/Exceptions/'; // The processors path. $processors = __DIR__ . '/Processors/'; // The providers path. $providers = __DIR__ . '/Providers/'; // The jobs path. $jobs = __DIR__ . '/Jobs/'; // The migrations path. $migrations = __DIR__ . '/Migrations/'; // The authorization tag. $tag = 'administration'; // Add all publishable scaffolding. $this->publishes([$assets => public_path(), $views => resource_path('views'), $controllers => app_path('Http/Controllers'), $presenters => app_path('Http/Presenters'), $requests => app_path('Http/Requests'), $middleware => app_path('Http/Middleware'), $routes => app_path('Http/administration.php'), $models => app_path('Models'), $exceptions => app_path('Exceptions'), $processors => app_path('Processors'), $providers => app_path('Providers'), $jobs => app_path('Jobs'), $migrations => database_path('migrations')], $tag); }
/** * Bootstrap the application services. * * @return void */ public function boot() { $this->publishes([__DIR__ . '/../../config/apiutils.php' => config_path('apiutils.php')]); $this->publishes([__DIR__ . '/../../config/routeparamsmapping.php' => config_path('routeparamsmapping.php')]); $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang/', 'apiutils'); $this->publishes([__DIR__ . '/../../resources/lang/' => resource_path('lang/vendor/apiutils')]); }
public function handle() { $generator = (require resource_path('crud/generator.php')); foreach ($generator as $name => $config) { Artisan::call('crud:generate', $this->buildOptions($name, $config)); } }
/** * Bootstrap the application services. * * @return void */ public function boot(Router $router) { $this->loadViewsFrom(__DIR__ . '/views', 'jiracal'); $this->publishes([__DIR__ . '/views' => resource_path('views/vendor/jiracal')], 'views'); $this->publishes([__DIR__ . '/config/jiracal.php' => config_path('jiracal.php')], 'config'); parent::boot($router); }
/** * it replace most thing that you can in boot in provider for packages * * @param string $dir * @return void */ public function fullBoot($package, $dir) { if (file_exists($dir . '/routes.php')) { if (!$this->app->routesAreCached()) { require $dir . '/routes.php'; } } if (file_exists($dir . '/views')) { $this->loadViewsFrom($dir . '/views', $package); } if (file_exists($dir . '/migrations')) { $this->publishes([$dir . '/migrations' => base_path('database/migrations/')], 'migrations'); } if (file_exists($dir . '/seeds')) { $this->publishes([$dir . '/seeds' => base_path('database/seeds/')], 'seeds'); } if (file_exists($dir . "config/{$package}.php")) { $this->mergeConfigFrom($dir . "config/{$package}.php", $package); $this->publishes([$dir . '/config' => base_path('config')], 'config'); } if (file_exists($dir . '/lang')) { $this->publishes([$dir . '/lang' => resource_path() . "/lang/vendor/{$package}"]); $this->loadTranslationsFrom($dir . "/lang", $package); } if (file_exists($dir . '/assets')) { $this->publishes([$dir . '/assets' => base_path('resources/assets')], 'assets'); } }
/** * Bootstrap the application events. */ public function boot() { $this->publishes([__DIR__ . '/../config/laravel-geo.php' => config_path('laravel-geo.php')], 'config'); $this->publishes([__DIR__ . '/../database/migrations/' => database_path('migrations')], 'migrations'); $this->publishes([__DIR__ . '/../public/js/' => public_path('vendor/roem')], 'public'); $this->publishes([__DIR__ . '/../resources/js/' => resource_path('assets/vendor/roem/laravel-geo')], 'resources'); }
/** * Perform post-registration booting of services. * * @return void */ public function boot() { /** * Copy the invitation files to the app. */ $this->publishes([__DIR__ . '/Lang/en/' => resource_path('lang/en'), __DIR__ . '/Views/' => resource_path('views/vendor/gocanto'), __DIR__ . '/Config/userinvitations.php' => config_path('userinvitations.php'), __DIR__ . '/Migrations/create_invitation_users_table.php' => database_path('migrations/create_invitation_users_table.php')]); }
/** * @return ImagickContract */ private function waterMark() { if (!$this->waterMark->count()) { $this->waterMark->setBackgroundColor(new ImagickPixel('transparent')); $this->waterMark->readImage(resource_path(self::LOCATION)); } return $this->waterMark; }
/** * @return void */ public function boot() { $this->app->make('events')->subscribe(RouteRegistrar::class); $this->configureFormRequests(); $this->loadViewsFrom(resource_path('errors'), 'error'); $this->loadViewsFrom(resource_path('views/admin'), 'admin'); $this->loadViewsFrom(resource_path('views/theme'), 'theme'); }
/** * Boot service provider. * * @return void */ public function boot() { $this->loadTranslationsFrom(__DIR__ . '/../../translations', 'verification'); $this->loadViewsFrom(__DIR__ . '/../../views', 'verification'); $this->publishes([__DIR__ . '/../../config/verification.php' => config_path('verification.php')], 'config'); $this->publishes([__DIR__ . '/../../translations' => resource_path('lang/vendor/verification')], 'translations'); $this->publishes([__DIR__ . '/../../views' => resource_path('views/vendor/verification')], 'views'); }
/** * @return void */ public function boot() { if (!$this->app->isInstalled()) { $this->app->make('router')->resource('/', InstallController::class); } $this->commands([InstallCommand::class]); $this->loadViewsFrom(resource_path('views/install'), 'install'); }
/** * Method boot() */ public function boot() { $this->publishes([__DIR__ . '/../config/frontend.php' => config_path('frontend.php')], 'config'); // Instal theme 01_bootstrap4_jumbotron $this->publishes([__DIR__ . '/../public/themes/01_bootstrap4_jumbotron' => public_path('/vendor/frontend/themes/01_bootstrap4_jumbotron')], '01_bootstrap4_jumbotron'); $this->publishes([__DIR__ . '/../resources/views/themes/01_bootstrap4_jumbotron' => resource_path('views/vendor/frontend/themes/01_bootstrap4_jumbotron')], '01_bootstrap4_jumbotron'); $this->loadViewsFrom(__DIR__ . '/../resources/views', 'frontend'); }
/** * Write the Markdown template for the mailable. * * @return void */ protected function writeMarkdownTemplate() { $path = resource_path('views/' . str_replace('.', '/', $this->option('markdown'))) . '.blade.php'; if (!$this->files->isDirectory(dirname($path))) { $this->files->makeDirectory(dirname($path), 0755, true); } $this->files->put($path, file_get_contents(__DIR__ . '/stubs/markdown.stub')); }
/** * Load a file and parse the the content. * * @param string $file * @param array $tokens * * @return string */ public function parseFile($file, array $tokens = []) { $template = resource_path('scripts/' . str_replace('.', '/', $file) . '.sh'); if (file_exists($template)) { return $this->parseString(file_get_contents($template), $tokens); } throw new \RuntimeException('Template ' . $template . ' does not exist'); }
/** * Bootstrap the application events. * * @return void */ public function boot(DispatcherContract $events) { parent::boot($events); //$this->loadViewsFrom(__DIR__.'/views', 'shareable'); $this->publishes([__DIR__ . '/views' => resource_path('views/vendor/shareable')]); $this->publishes([__DIR__ . '/config/config.php' => config_path('shareable.php')]); //$this->package('ryannielson/shareable'); }
/** * Perform post-registration booting of services. * * @return void */ public function boot() { if (!$this->app->routesAreCached()) { require __DIR__ . '/routes.php'; } $this->publishes([__DIR__ . '/views' => resource_path('views/vendor/deploy'), __DIR__ . '/config/deploy.php' => config_path('deploy.php')]); $this->loadViewsFrom(__DIR__ . '/views', 'deploy'); }
/** * Bootstrap the application events. * * @return void */ public function boot() { $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'usuarios'); $this->loadViewsFrom(__DIR__ . '/../../resources/views', 'usuarios'); $this->publishes([__DIR__ . '/../../config/usuarios.php' => config_path('usuarios.php')]); $this->publishes([__DIR__ . '/../../resources/views' => resource_path('views/idrd/usuarios')]); $this->publishes([__DIR__ . '/../../resources/assets' => public_path('Js/usuarios')], 'public'); }
public function render($view, $data) { $view = resource_path() . '/views/' . str_replace('.', '/', $view) . '.latte'; foreach ($this->globals->getGlobals() as $key => $value) { $data[$key] = $value; } return $this->latte->render($view, $data); }
/** * Copy migration to root project * * @param Application $app */ private function initCMS(Application $app) { if ($app instanceof \Illuminate\Foundation\Application && $app->runningInConsole()) { $migrationPath = realpath(__DIR__ . '/migration'); (new Filesystem())->makeDirectory(app_path('Models'), 0755, false, true); $this->publishes([$migrationPath => database_path('migrations'), __DIR__ . "/module" => app_path('Http/Modules'), __DIR__ . "/resource" => resource_path(), __DIR__ . "/gulp" => base_path(), __DIR__ . "/configs" => config_path('cms')]); } }