← prev | next →
DukeKwaku 2021-02-09 15:49:37
how can I set causer in model event log using spatie activity log package
krishu_7 2021-02-09 15:52:43
DesolatorMagno 2021-02-09 15:37:05
At a final note, you don’t need to do it in simple array, you can do something like.
STATUS => [
‘disabled’ => [
‘input’ = ‘Disable’,
‘value’ = 1
],
];
Can you please tell me how can I use that in switch cases with that constant values set in config/enum.php
greatCobby 2021-02-09 15:53:43
Hello guys, I need someone here to partner me in a laravel project.
Payment involved. Experienced developers only. Kindly inbox me if interested.
DesolatorMagno 2021-02-09 15:57:13
imad_khamkhami 2021-02-09 15:48:46
Answer ??
Question???
DesolatorMagno 2021-02-09 15:57:47
DukeKwaku 2021-02-09 15:49:37
how can I set causer in model event log using spatie activity log package
Until where I remember it set automatically the log in user as causer.
DesolatorMagno 2021-02-09 15:58:24
krishu_7 2021-02-09 15:52:43
Can you please tell me how can I use that in switch cases with that constant values set in config/enum.php
You know how to declare and use constants?
DesolatorMagno 2021-02-09 15:58:46
Don’t try to fly before learning to walk
nazmulpcc 2021-02-09 16:00:11
krishu_7 2021-02-09 15:52:43
Can you please tell me how can I use that in switch cases with that constant values set in config/enum.php
Use Interfaces/Classes containing constants for this type of data. then for a switch case you can call that class constant
Sysome 2021-02-09 16:45:00
Yan Ever 2021-02-09 14:04:51
show you obtains $email_list in y’re code for see the collection type
Okay, let me try. Thank you
Sysome 2021-02-09 16:45:35
vek866q 2021-02-09 12:45:49
Your should generate your mail list as an array and not as a string. e.g [’emailone’, [’emial2′]]
Let me try, thank you.
rootkings 2021-02-09 16:52:54
hey guys, i have a question about pure php. Now when we use the in laravel blade old method in input, how we can do that in pure php? For example:we have user loggin page when username and password wrong i want to return in username input old input value.
sbruder 2021-02-09 17:01:37
old() in laravel encapsulates a lot, it’s not just a function but the whole process with redirect and session data and so on.
sbruder 2021-02-09 17:01:59
sure, you can redo that in pure php. but it’s not small work.
DesolatorMagno 2021-02-09 17:07:12
You could read the source code and get a idea of how it works, you could do something similar using session and helper method, like
old() =
return isset($_SESSION[old]) && isset($_SESSION[old][$INPUT])
(That’s only a primitive example, i don’t recommend using globals like that)
krishu_7 2021-02-09 17:12:05
nazmulpcc 2021-02-09 16:00:11
Use Interfaces/Classes containing constants for this type of data. then for a switch case you can call that class constant
Thanks it worked 🙂
DesolatorMagno 2021-02-09 17:12:44
DesolatorMagno 2021-02-09 17:07:12
You could read the source code and get a idea of how it works, you could do something similar using session and helper method, like
old() =
return isset($_SESSION[old]) && isset($_SESSION[old][$INPUT])
(That’s only a primitive example, i don’t recommend using globals like that)
That is taking in account that you do things like set the old manually in the controller, the more magic you want the harder it become.
DukeKwaku 2021-02-09 17:23:56
DesolatorMagno 2021-02-09 15:57:47
Until where I remember it set automatically the log in user as causer.
It doesn’t work for me.
I’m using bagisto.
I use causedBy() to set it in any controller that I perform activity log operation.
But I want to set causer in model but I don’t know how to do that
DesolatorMagno 2021-02-09 17:24:34
Did you read the oficial documentation?
DukeKwaku 2021-02-09 17:25:05
Yes
DesolatorMagno 2021-02-09 17:25:38

It always worked for me like that.
DukeKwaku 2021-02-09 17:26:07

I saw this… But it doesn’t give me any clues.
DukeKwaku 2021-02-09 17:26:24
DesolatorMagno 2021-02-09 17:25:38
It always worked for me like that.
Inside the model?
DesolatorMagno 2021-02-09 17:26:34
You are logging model events?
DukeKwaku 2021-02-09 17:26:49
DesolatorMagno 2021-02-09 17:26:34
You are logging model events?
Yes
DesolatorMagno 2021-02-09 17:27:49
DukeKwaku 2021-02-09 17:26:07
I saw this… But it doesn’t give me any clues.
That is not for causer, it just give relationship.
DukeKwaku 2021-02-09 17:27:58
Okay
imad_khamkhami 2021-02-09 17:28:00
what caused this error??
DukeKwaku 2021-02-09 17:28:14
DesolatorMagno 2021-02-09 17:27:49
That is not for causer, it just give relationship.
I want causer in model event
DesolatorMagno 2021-02-09 17:28:52
In worst case scenario you can try using tapActivity
DukeKwaku 2021-02-09 17:29:41
DesolatorMagno 2021-02-09 17:28:52
In worst case scenario you can try using tapActivity
Okay. Inside the model?
DesolatorMagno 2021-02-09 17:29:49
imad_khamkhami 2021-02-09 17:28:00
what caused this error??
Check that App/User exist.
DesolatorMagno 2021-02-09 17:29:59
https://spatie.be/docs/laravel-activitylog/v3/advanced-usage/logging-model-events#tap-activity-before-logged-from-event
Logging model events | laravel-activitylog –
spatie.be
DukeKwaku 2021-02-09 17:30:17
DesolatorMagno 2021-02-09 17:29:59
https://spatie.be/docs/laravel-activitylog/v3/advanced-usage/logging-model-events#tap-activity-before-logged-from-event
Ok
DukeKwaku 2021-02-09 17:31:18
I’ll try that. Thanks
← prev | next →