This class is registered as singleton and will allow you to set causer for activity globally or per action basis.
Note that Overriding causer using setCauser
method takes priority over overriding the resolver using resolveUsing
method.
CauserResolver::setCauser(User::find(1));
$log = activity()->log('log look mom, I did something...');
$log->causer;
##resolve
public function resolve(Model | int | string | null $subject = null) : ?Model;
##resolveUsing
public function resolveUsing(Closure $callback): static;
##setCauser
public function setCauser(?Model $causer): static;