This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($request->hasFile('image')) { | |
// New image | |
$request->validate([ | |
'image' => ['image', 'mimes:jpeg,png,jpg,webp', 'max:2048'], | |
], [ | |
'image.image' => 'File harus berupa gambar.', | |
'image.mimes' => 'File harus berupa gambar.', | |
'image.max' => 'Ukuran gambar maksimal 2MB.', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="col-span-1 rounded-lg"> | |
<div class=""> | |
<img v-if="imageURL" :src="imageURL" class="mx-auto w-full rounded-lg" alt="image" /> | |
<p v-else class="p-3 text-center text-sm">Mohon upload gambar produk.</p> | |
</div> | |
<div class="p-8 text-center"> | |
<button | |
type="button" |