Skip to content

Updated By should not be updated if there is no user authenticated #16

@22Nick22

Description

@22Nick22

Summary of problem or feature request

Setting the updated_by field in a Factory has no effect as the value is overwritten by null on save due to there being no currently authenticated user.

Code snippet of problem

    public function definition()
    {
        return [
            'name' => $this->faker->name,
            'email' => $this->faker->unique()->safeEmail,
            'email_verified_at' => now(),
            'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
            'remember_token' => Str::random(10),
            'created_by' => 3, // Stamped as 3
            'updated_by' => 3, // Stamped as NULL
        ];
    }

System details

  • Operating System - PopOS
  • PHP Version - 7.4.9
  • Laravel Version - 8.21.0
  • Laravel-Auditable Version - 4.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions