diff --git a/src/Illuminate/Filesystem/Filesystem.php b/src/Illuminate/Filesystem/Filesystem.php index ef732991d867..23fc17eeb03c 100644 --- a/src/Illuminate/Filesystem/Filesystem.php +++ b/src/Illuminate/Filesystem/Filesystem.php @@ -268,11 +268,12 @@ public function prepend($path, $data) * * @param string $path * @param string $data + * @param bool $lock * @return int */ - public function append($path, $data) + public function append($path, $data, $lock = false) { - return file_put_contents($path, $data, FILE_APPEND); + return file_put_contents($path, $data, FILE_APPEND | ($lock ? LOCK_EX : 0)); } /** diff --git a/src/Illuminate/Support/Facades/File.php b/src/Illuminate/Support/Facades/File.php index 8fa9aee26b6d..a1ade8789643 100755 --- a/src/Illuminate/Support/Facades/File.php +++ b/src/Illuminate/Support/Facades/File.php @@ -16,7 +16,7 @@ * @method static void replace(string $path, string $content, int|null $mode = null) * @method static void replaceInFile(array|string $search, array|string $replace, string $path) * @method static int prepend(string $path, string $data) - * @method static int append(string $path, string $data) + * @method static int append(string $path, string $data, bool $lock = false) * @method static mixed chmod(string $path, int|null $mode = null) * @method static bool delete(string|array $paths) * @method static bool move(string $path, string $target)