Skip to content

Commit 35d6956

Browse files
committed
Create ExampleServiceProvider.php
1 parent fa94ebe commit 35d6956

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

Diff for: src/ExampleServiceProvider.php

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?php
2+
3+
namespace :vendor_namespace\:package_class_name;
4+
5+
use Illuminate\Support\ServiceProvider;
6+
7+
class :package_class_nameServiceProvider extends ServiceProvider
8+
{
9+
/**
10+
* Perform post-registration booting of services.
11+
*
12+
* @return void
13+
*/
14+
public function boot(): void
15+
{
16+
// $this->loadTranslationsFrom(__DIR__.'/../resources/lang', ':vendor_slug');
17+
// $this->loadViewsFrom(__DIR__.'/../resources/views', ':vendor_slug');
18+
// $this->loadMigrationsFrom(__DIR__.'/../database/migrations');
19+
// $this->loadRoutesFrom(__DIR__.'/routes.php');
20+
21+
// Publishing is only necessary when using the CLI.
22+
if ($this->app->runningInConsole()) {
23+
$this->bootForConsole();
24+
}
25+
}
26+
27+
/**
28+
* Register any package services.
29+
*
30+
* @return void
31+
*/
32+
public function register(): void
33+
{
34+
// $this->mergeConfigFrom(__DIR__.'/../config/:package_slug.php', ':package_slug');
35+
36+
// // Register the service the package provides.
37+
// $this->app->singleton(':package_slug', function ($app) {
38+
// return new :uc:package;
39+
// });
40+
}
41+
42+
/**
43+
* Get the services provided by the provider.
44+
*
45+
* @return array
46+
*/
47+
public function provides()
48+
{
49+
return [':package_slug'];
50+
}
51+
52+
/**
53+
* Console-specific booting.
54+
*
55+
* @return void
56+
*/
57+
protected function bootForConsole(): void
58+
{
59+
// // Publishing the configuration file.
60+
// $this->publishes([
61+
// __DIR__.'/../config/:package_slug.php' => config_path(':package_slug.php'),
62+
// ], ':package_slug.config');
63+
64+
// // Publishing the views.
65+
// /*$this->publishes([
66+
// __DIR__.'/../resources/views' => base_path('resources/views/vendor/:vendor_slug'),
67+
// ], ':package_slug.views');*/
68+
69+
// // Publishing assets.
70+
// /*$this->publishes([
71+
// __DIR__.'/../resources/assets' => public_path('vendor/:vendor_slug'),
72+
// ], ':package_slug.views');*/
73+
74+
// // Publishing the translation files.
75+
// /*$this->publishes([
76+
// __DIR__.'/../resources/lang' => resource_path('lang/vendor/:vendor_slug'),
77+
// ], ':package_slug.views');*/
78+
79+
// // Registering package commands.
80+
// // $this->commands([]);
81+
}
82+
}

0 commit comments

Comments
 (0)