0

I have several classes where I update the model. In the model I have created boot methods where I call some logic and in this logic I want to know which class is the initiator of the Model being updating or creating.

How can I find out this?

EzLo
  • 13,780
  • 10
  • 33
  • 38
RIPOL92
  • 59
  • 5
  • You can try to use [`debug_backtrace()`](https://www.php.net/manual/ru/function.debug-backtrace.php) to get calls stack. Than search what was before your model calls. – Tarasovych Apr 12 '19 at 04:58
  • @Tarasovych i have tried this method but in laravel this show a looot of data and function works very slowly. – RIPOL92 Apr 12 '19 at 05:17
  • [Also take a look](https://stackoverflow.com/a/11238046/9506712) – Tarasovych Apr 12 '19 at 05:19

0 Answers0