本文整理汇总了PHP中Illuminate\Support\Facades\App::register方法的典型用法代码示例。如果您正苦于以下问题:PHP App::register方法的具体用法?PHP App::register怎么用?PHP App::register使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\App
的用法示例。
在下文中一共展示了App::register方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: boot
public function boot()
{
// Service provider
App::register('\\Maatwebsite\\Excel\\ExcelServiceProvider');
// Register alias
$alias = AliasLoader::getInstance();
$alias->alias('Excel', '\\Maatwebsite\\Excel\\Facades\\Excel');
}
示例2: register
/**
* Register the application services.
*
* @return void
*/
public function register()
{
App::register(\EasySlug\EasySlug\EasySlugServiceProvider::class);
$this->app->bindShared('command.forum.table', function ($app) {
return new MigrateForumCommand();
});
$this->commands('command.forum.table');
include __DIR__ . '/../routes.php';
}
示例3: register
/**
* Register the application services.
*
* @return void
*/
public function register()
{
// Register the HtmlServiceProvider
App::register(HtmlServiceProvider::class);
// Add aliases to Form/Html Facade
$loader = AliasLoader::getInstance();
$loader->alias('Form', FormFacade::class);
$loader->alias('HTML', HtmlFacade::class);
// Add alias for datagrid
$loader->alias('Datagrid', 'Aginev\\Datagrid\\Datagrid');
}
示例4: register
/**
* Register the application services.
*
* @return void
*/
public function register()
{
// Register the HtmlServiceProvider
App::register('Illuminate\\Html\\HtmlServiceProvider');
// Add aliases to Form/Html Facade
$loader = AliasLoader::getInstance();
$loader->alias('Form', 'Illuminate\\Html\\FormFacade');
$loader->alias('HTML', 'Illuminate\\Html\\HtmlFacade');
// Register the acl:fill-permissions command
$this->app['acl:fill-permissions'] = $this->app->share(function ($app) {
return new AclFill();
});
$this->commands('acl:fill-permissions');
}
示例5: boot
public function boot()
{
App::register(\MatthC\Privileges\PrivilegesServiceProvider::class);
App::register(\HieuLe\Active\ActiveServiceProvider::class);
App::bind('Active', function () {
return new \HieuLe\Active\Facades\Active();
});
$this->loadViewsFrom(__DIR__ . '/../../resources/views', 'laradmin');
$this->publishes([__DIR__ . '/../config/laradmin.php' => config_path('laradmin.php')]);
$this->publishes([__DIR__ . '/../../public' => public_path('vendor/laradmin')], 'public');
if (!$this->app->routesAreCached()) {
require __DIR__ . '/../routes.php';
}
}
示例6: register
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->package('selmonal/imagemanager');
$path = realpath(__DIR__ . "/../../views");
// naming views
View::addNamespace('SIM', $path);
App::bind('Selmonal\\Imagemanager\\ImageRepositoryInterface', 'Selmonal\\Imagemanager\\EloquentImageRepository');
// Intervention image manipulator
App::register("Intervention\\Image\\ImageServiceProvider");
$this->app->bind("Selmonal\\Imagemanager\\ImageManipulator", function () {
$basePath = public_path() . Config::get("imagemanager::basePath");
$sizes = Config::get("imagemanager::sizes");
return new \Selmonal\Imagemanager\ImageManipulator($basePath, $sizes);
});
}
示例7: register
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
$app = $this->app;
$app['social'] = $app->share(function ($app) {
return new Social();
});
require __DIR__ . '/../../routes.php';
require __DIR__ . '/../../filters.php';
// Registramos el componente de twitter
App::register('Thujohn\\Twitter\\TwitterServiceProvider');
$this->app->bind('SocialTw', function ($app) {
return new Twitter(Config::get('social::twitter'), $app['session.store']);
});
}
示例8: boot
/**
* @return $this
*/
public function boot()
{
if (!$this->_isBooted) {
$this->loadViews();
$this->loadTranslations();
$this->loadAssets();
$this->loadConfig();
$serviceProviderPath = $this->getServiceProviderPath();
if (is_file($serviceProviderPath)) {
App::register($this->getNamespace() . '\\Providers\\ModuleServiceProvider');
}
$this->_isBooted = TRUE;
}
return $this;
}
示例9: registerCoreEventServiceProvider
protected function registerCoreEventServiceProvider()
{
App::register(new CoreEventServiceProvider($this->app));
}
示例10: _before
public function _before()
{
// We have a problem here in that foreach fixture,
// from the traitsProvider() method, the _before()
// and _after() method are invoked. This is painfully
// slow.
// Avoid traditional startup...
//parent::_before();
// Create faker if needed
if (!isset($this->faker)) {
$this->faker = FakerFactory::create();
}
// Start Laravel app.
if (!$this->hasApplicationBeenStarted()) {
$this->startApplication();
}
// Before we obtain it - we need to make a small configuration
// because the test-fixtures in Orchestra doesn't contain it.
// We are generating it here, more or less just like Laravel
ConfigFacade::set('app.key', Str::random(32));
// HOTFIX, see https://github.com/orchestral/testbench/pull/128
// This can be removed again, when fixed by author
if (!ConfigFacade::has('broadcasting.connections.null')) {
ConfigFacade::set('broadcasting.connections.null', ['driver' => 'null']);
}
// HOTFIX, see https://github.com/orchestral/testbench/pull/129
// This can be removed again, when fixed by author
$providers = ConfigFacade::get('app.providers');
if (!in_array(\Illuminate\Notifications\NotificationServiceProvider::class, $providers)) {
App::register(\Illuminate\Notifications\NotificationServiceProvider::class);
}
}
示例11: registerMarketingEventServiceProvider
protected function registerMarketingEventServiceProvider()
{
App::register(new MarketingEventServiceProvider($this->app));
}