You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,8 @@ Provides logging and email notifications for Laravel console commands.
35
35
36
36
## Troubleshooting
37
37
38
+
#### Trait included, but nothing happens?
39
+
38
40
Note, that `Loggable` trait is overriding `initialize` method:
39
41
```php
40
42
trait Loggable
@@ -65,3 +67,37 @@ class Foo extends Command
65
67
// ...
66
68
}
67
69
```
70
+
71
+
#### Several traits conflict?
72
+
73
+
If you're using some other cool `illuminated/console-%` packages, well, then you can find yourself getting "traits conflict".
74
+
For example, if you're trying to build loggable command, which is [protected against overlapping](https://packagist.org/packages/illuminated/console-mutex):
75
+
```php
76
+
class Foo extends Command
77
+
{
78
+
use Loggable;
79
+
use WithoutOverlapping;
80
+
81
+
// ...
82
+
}
83
+
```
84
+
85
+
You'll get fatal error, the "traits conflict", because both of these traits are overriding `initialize` method:
86
+
>If two traits insert a method with the same name, a fatal error is produced, if the conflict is not explicitly resolved.
87
+
88
+
But don't worry, solution is very simple. Just override `initialize` method by yourself, and initialize traits in required order:
0 commit comments