4
4
5
5
namespace CalebDW \Laraflake ;
6
6
7
- use CalebDW \Laraflake \Mixins \ BlueprintMixin ;
8
- use CalebDW \Laraflake \Mixins \ RuleMixin ;
9
- use CalebDW \Laraflake \Mixins \ StrMixin ;
7
+ use CalebDW \Laraflake \Macros \ BlueprintMacros ;
8
+ use CalebDW \Laraflake \Macros \ RuleMacros ;
9
+ use CalebDW \Laraflake \Macros \ StrMacros ;
10
10
use Composer \InstalledVersions ;
11
11
use Godruoyi \Snowflake \FileLockResolver ;
12
12
use Godruoyi \Snowflake \LaravelSequenceResolver ;
18
18
use Godruoyi \Snowflake \Sonyflake ;
19
19
use Godruoyi \Snowflake \SwooleSequenceResolver ;
20
20
use Illuminate \Contracts \Cache \Repository ;
21
- use Illuminate \Database \ Schema \ Blueprint ;
21
+ use Illuminate \Contracts \ Foundation \ Application ;
22
22
use Illuminate \Foundation \Console \AboutCommand ;
23
23
use Illuminate \Support \ServiceProvider as IlluminateServiceProvider ;
24
- use Illuminate \Support \Str ;
25
- use Illuminate \Validation \Rule ;
26
24
use InvalidArgumentException ;
27
25
28
26
/**
@@ -50,7 +48,7 @@ public function boot(): void
50
48
{
51
49
$ this ->publishes ([__DIR__ . '/../config/laraflake.php ' => config_path ('laraflake.php ' )]);
52
50
53
- $ this ->registerMixins ();
51
+ $ this ->registerMacros ();
54
52
55
53
AboutCommand::add ('Laraflake ' , function () {
56
54
/** @var LaraflakeConfig $config */
@@ -76,17 +74,17 @@ public function boot(): void
76
74
}
77
75
78
76
/** Register custom mixins. */
79
- protected function registerMixins (): void
77
+ protected function registerMacros (): void
80
78
{
81
- Blueprint:: mixin ( new BlueprintMixin () );
82
- Str:: mixin ( new StrMixin () );
83
- Rule:: mixin ( new RuleMixin () );
79
+ BlueprintMacros:: boot ( );
80
+ RuleMacros:: boot ( );
81
+ StrMacros:: boot ( );
84
82
}
85
83
86
84
/** Register the Snowflake singleton. */
87
85
protected function registerSnowflake (): void
88
86
{
89
- $ this ->app ->singleton (Snowflake::class, function ($ app ) {
87
+ $ this ->app ->singleton (Snowflake::class, function (Application $ app ) {
90
88
/** @var LaraflakeConfig $config */
91
89
$ config = config ('laraflake ' );
92
90
@@ -103,7 +101,7 @@ protected function registerSnowflake(): void
103
101
/** Bind the Snowflake sequence resolver. */
104
102
protected function registerSequenceResolver (): void
105
103
{
106
- $ this ->app ->bind (SequenceResolver::class, function ($ app ) {
104
+ $ this ->app ->bind (SequenceResolver::class, function (Application $ app ) {
107
105
if (! $ app ->has ('cache.store ' )) {
108
106
return new RandomSequenceResolver ();
109
107
}
0 commit comments