-8
changelog.md
-8
changelog.md
-8
src/AtpReplicator.php
-8
src/AtpReplicator.php
-82
src/AtpReplicatorServiceProvider.php
-82
src/AtpReplicatorServiceProvider.php
···
1
-
<?php
2
-
3
-
namespace SocialDept\AtpReplicator;
4
-
5
-
use Illuminate\Support\ServiceProvider;
6
-
7
-
class AtpReplicatorServiceProvider 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', 'social-dept');
17
-
// $this->loadViewsFrom(__DIR__.'/../resources/views', 'social-dept');
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/atp-replicator.php', 'atp-replicator');
35
-
36
-
// Register the service the package provides.
37
-
$this->app->singleton('atp-replicator', function ($app) {
38
-
return new AtpReplicator;
39
-
});
40
-
}
41
-
42
-
/**
43
-
* Get the services provided by the provider.
44
-
*
45
-
* @return array
46
-
*/
47
-
public function provides()
48
-
{
49
-
return ['atp-replicator'];
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/atp-replicator.php' => config_path('atp-replicator.php'),
62
-
], 'atp-replicator.config');
63
-
64
-
// Publishing the views.
65
-
/*$this->publishes([
66
-
__DIR__.'/../resources/views' => base_path('resources/views/vendor/social-dept'),
67
-
], 'atp-replicator.views');*/
68
-
69
-
// Publishing assets.
70
-
/*$this->publishes([
71
-
__DIR__.'/../resources/assets' => public_path('vendor/social-dept'),
72
-
], 'atp-replicator.assets');*/
73
-
74
-
// Publishing the translation files.
75
-
/*$this->publishes([
76
-
__DIR__.'/../resources/lang' => resource_path('lang/vendor/social-dept'),
77
-
], 'atp-replicator.lang');*/
78
-
79
-
// Registering package commands.
80
-
// $this->commands([]);
81
-
}
82
-
}
-18
src/Facades/AtpReplicator.php
-18
src/Facades/AtpReplicator.php
···
1
-
<?php
2
-
3
-
namespace SocialDept\AtpReplicator\Facades;
4
-
5
-
use Illuminate\Support\Facades\Facade;
6
-
7
-
class AtpReplicator extends Facade
8
-
{
9
-
/**
10
-
* Get the registered name of the component.
11
-
*
12
-
* @return string
13
-
*/
14
-
protected static function getFacadeAccessor(): string
15
-
{
16
-
return 'atp-replicator';
17
-
}
18
-
}