$hashes */ public array $hashes = []; /** * Prepare old hashes. * * @param list $oldHashes * @return void */ public function mount( array $oldHashes = [] ): void { foreach ($oldHashes as $hash) { $this->addHash( $hash['filename'], $hash['hash_crc32'], $hash['hash_sha1'], $hash['verified'] ); } } /** * Add an hash to the list. * * @param string $filename * @param string $crc32 * @param string $sha1 * @param string|null $verified * * @return void */ public function addHash(string $filename, string $crc32, string $sha1, ?string $verified = null): void { $this->hashes[] = [ 'filename' => $filename, 'hash_crc32' => $crc32, 'hash_sha1' => $sha1, 'verified' => $verified ?? "No-Intro" // TODO: Change it. ]; } /** * Remove a specific hash. * * @param int $index * @return void */ public function removeHash(int $index): void { array_splice($this->hashes, $index, 1); } public function render(): View { return view('livewire.hashes-upload'); } }