I want to pass a variable in the controller to the model in laravel.
In Controller,
$withoutUser = True;
$post->update([
'status' => 'inactive'
]);
In model,
protected static function boot(): void
{
parent::boot();
static::updated(fn (Model $model) =>
// Need to access the $withoutUser variable from here?
);
}
Is there a method to pass the $withoutUser variable when calling $post->update() or is it possible to access the $withoutUser variable in the controller when the static::updated method is called in model?
Thanks