Skip to content

Instantly share code, notes, and snippets.

View umaraziz0's full-sized avatar
🎯
Focusing

Aziz umaraziz0

🎯
Focusing
  • Xylo Indonesia
  • Jakarta, Indonesia
View GitHub Profile
@umaraziz0
umaraziz0 / updateImage.php
Created April 28, 2022 05:53
[Laravel] Update Image
<?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.',
@umaraziz0
umaraziz0 / uploadImage.vue
Last active May 17, 2022 04:05
[Vue] Upload Image
<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"