92 lines
1.6 KiB
Plaintext
Raw Normal View History

2017-09-14 22:21:00 +03:00
<?php
namespace $NAMESPACE$;
2019-11-16 10:21:14 +03:00
use Illuminate\Support\ServiceProvider as Provider;
2017-09-14 22:21:00 +03:00
2019-11-16 10:21:14 +03:00
class $NAME$ extends Provider
2017-09-14 22:21:00 +03:00
{
/**
* Boot the application events.
*
* @return void
*/
public function boot()
{
2019-11-16 10:21:14 +03:00
$this->loadViews();
2020-01-16 15:39:37 +03:00
$this->loadTranslations();
2019-11-16 10:21:14 +03:00
$this->loadMigrations();
2017-09-14 22:21:00 +03:00
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
2019-11-16 10:21:14 +03:00
$this->loadRoutes();
2017-09-14 22:21:00 +03:00
}
/**
2019-11-16 10:21:14 +03:00
* Load views.
2017-09-14 22:21:00 +03:00
*
* @return void
*/
2019-11-16 10:21:14 +03:00
public function loadViews()
2017-09-14 22:21:00 +03:00
{
2019-11-16 10:21:14 +03:00
$this->loadViewsFrom(__DIR__ . '/../Resources/views', '$ALIAS$');
2017-09-14 22:21:00 +03:00
}
/**
2019-11-16 10:21:14 +03:00
* Load translations.
2017-09-14 22:21:00 +03:00
*
* @return void
*/
2019-11-16 10:21:14 +03:00
public function loadTranslations()
2017-09-14 22:21:00 +03:00
{
2019-11-16 10:21:14 +03:00
$this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', '$ALIAS$');
2017-09-14 22:21:00 +03:00
}
/**
2019-11-16 10:21:14 +03:00
* Load migrations.
2017-09-14 22:21:00 +03:00
*
* @return void
*/
2019-11-16 10:21:14 +03:00
public function loadMigrations()
2017-09-14 22:21:00 +03:00
{
2019-11-16 10:21:14 +03:00
$this->loadMigrationsFrom(__DIR__ . '/../$MIGRATIONS_PATH$');
2017-09-14 22:21:00 +03:00
}
/**
2019-11-16 10:21:14 +03:00
* Load routes.
*
* @return void
2017-09-14 22:21:00 +03:00
*/
2019-11-16 10:21:14 +03:00
public function loadRoutes()
2017-09-14 22:21:00 +03:00
{
2019-11-16 10:21:14 +03:00
if (app()->routesAreCached()) {
return;
}
$routes = [
'admin.php',
'portal.php',
];
foreach ($routes as $route) {
$this->loadRoutesFrom(__DIR__ . '/../$ROUTES_PATH$/' . $route);
2017-09-14 22:21:00 +03:00
}
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return [];
}
}