Merge branch 'master' of https://github.com/LailaWulandarii/Flo.do into development
|
|
@ -0,0 +1,3 @@
|
|||
vendor/
|
||||
node_modules/
|
||||
.git/
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
use App\Models\Buket;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class BuketController extends Controller
|
||||
{
|
||||
|
|
@ -59,10 +59,7 @@ public function store(Request $request)
|
|||
if ($request->hasFile('foto')) {
|
||||
$file = $request->file('foto');
|
||||
$filename = time() . '_' . $file->getClientOriginalName();
|
||||
|
||||
$file->move(public_path('img/buket'), $filename);
|
||||
|
||||
$path = 'img/buket/' . $filename;
|
||||
$path = $file->storeAs('img/buket', $filename, 'public');
|
||||
}
|
||||
|
||||
Buket::create([
|
||||
|
|
@ -121,16 +118,15 @@ public function update(Request $request, string $id)
|
|||
$data = $request->only(['nama', 'ukuran', 'kategori', 'harga', 'request_khusus', 'deskripsi']);
|
||||
|
||||
if ($request->hasFile('foto')) {
|
||||
// 1. Hapus foto lama jika ada
|
||||
if ($buket->foto) {
|
||||
File::delete(public_path($buket->foto));
|
||||
Storage::disk('public')->delete($buket->foto);
|
||||
}
|
||||
|
||||
// 2. Upload foto baru
|
||||
$file = $request->file('foto');
|
||||
$filename = time() . '_' . $file->getClientOriginalName();
|
||||
$file->move(public_path('img/buket'), $filename);
|
||||
$data['foto'] = 'img/buket/' . $filename;
|
||||
$path = $file->storeAs('img/buket', $filename, 'public');
|
||||
|
||||
$data['foto'] = $path;
|
||||
}
|
||||
|
||||
$buket->update($data);
|
||||
|
|
@ -143,7 +139,7 @@ public function destroy(string $id)
|
|||
$buket = Buket::findOrFail($id);
|
||||
|
||||
if ($buket->foto) {
|
||||
File::delete(public_path($buket->foto));
|
||||
Storage::disk('public')->delete($buket->foto);
|
||||
}
|
||||
$buket->delete();
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,7 @@
|
|||
use App\Models\PaketFoto;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class FotoController extends Controller
|
||||
{
|
||||
|
|
@ -61,9 +60,7 @@ public function store(Request $request)
|
|||
if ($request->hasFile('foto')) {
|
||||
$file = $request->file('foto');
|
||||
$filename = time() . '_' . $file->getClientOriginalName();
|
||||
// Simpan langsung ke folder public untuk asset()
|
||||
$file->move(public_path('img/foto'), $filename);
|
||||
$path = 'img/foto/' . $filename;
|
||||
$path = $file->storeAs('img/foto', $filename, 'public');
|
||||
}
|
||||
|
||||
PaketFoto::create([
|
||||
|
|
@ -114,15 +111,14 @@ public function update(Request $request, string $id)
|
|||
$data = $request->only(['nama', 'harga', 'durasi', 'deskripsi']);
|
||||
|
||||
if ($request->hasFile('foto')) {
|
||||
// Hapus file lama jika ada foto baru yang diunggah
|
||||
if ($paket->foto) {
|
||||
File::delete(public_path($paket->foto));
|
||||
Storage::disk('public')->delete($paket->foto);
|
||||
}
|
||||
|
||||
$file = $request->file('foto');
|
||||
$filename = time() . '_' . $file->getClientOriginalName();
|
||||
$file->move(public_path('img/foto'), $filename);
|
||||
$data['foto'] = 'img/foto/' . $filename;
|
||||
$path = $file->storeAs('img/foto', $filename, 'public');
|
||||
$data['foto'] = $path;
|
||||
}
|
||||
|
||||
$paket->update($data);
|
||||
|
|
@ -135,12 +131,9 @@ public function destroy(string $id)
|
|||
// Cari data berdasarkan primary key id_paket
|
||||
$paket = PaketFoto::where('id_paket', $id)->firstOrFail();
|
||||
|
||||
// 1. Cek dan hapus file foto dari folder public
|
||||
if ($paket->foto) {
|
||||
File::delete(public_path($paket->foto));
|
||||
Storage::disk('public')->delete($paket->foto);
|
||||
}
|
||||
|
||||
// 2. Hapus data dari database
|
||||
$paket->delete();
|
||||
|
||||
return redirect()->back()->with('success', 'Paket foto dan filenya berhasil dihapus!');
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public function index(Request $request)
|
|||
$buket = $query->paginate(8)->withQueryString();
|
||||
|
||||
if ($request->ajax()) {
|
||||
return view('user._list', compact('buket'))->render();
|
||||
return view('user.components._list', compact('buket'))->render();
|
||||
}
|
||||
|
||||
return view('user/pesan-buket', compact('buket'));
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ class Buket extends Model
|
|||
'ucapan',
|
||||
'harga',
|
||||
'foto',
|
||||
'kategori', // Enum
|
||||
'ukuran', // Enum
|
||||
'kategori',
|
||||
'ukuran',
|
||||
];
|
||||
|
||||
public function transaksi()
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
|
@ -25,5 +26,9 @@ public function boot()
|
|||
|
||||
// Opsional: Set timezone jika diperlukan
|
||||
date_default_timezone_set('Asia/Jakarta');
|
||||
|
||||
if (config('app.env') === 'production') {
|
||||
URL::forceScheme('https');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
0
database/migrations/2025_12_26_150607_create_transaksi_bukets_table.php
Executable file → Normal file
0
database/migrations/2025_12_26_150621_create_booking_fotos_table.php
Executable file → Normal file
0
database/migrations/2025_12_26_150637_create_detail_additionals_table.php
Executable file → Normal file
|
|
@ -28,42 +28,42 @@ public function run(): void
|
|||
'nama' => 'Group',
|
||||
'harga' => 80000,
|
||||
'deskripsi' => 'Untuk 3-5 orang, 15 menit sesi foto sepuasnya, 5 menit sesi pilih foto, 3 lembar print out foto ukutan 4R.',
|
||||
'foto' => 'img/foto/1767368465_grup.jpeg',
|
||||
'foto' => 'img/foto/grup.jpeg',
|
||||
'durasi' => '15',
|
||||
],
|
||||
[
|
||||
'nama' => 'Pas Foto Paket 1',
|
||||
'harga' => 25000,
|
||||
'deskripsi' => 'Sesi pas foto untuk 1 orang dengan 8x shoot fotografer. Termasuk 1 file foto edit dan bebas request warna background. Paket cetak: ukuran 2x3 (12 lembar).',
|
||||
'foto' => 'img/foto/1767368572_pas-foto.jpg',
|
||||
'foto' => 'img/foto/pas-foto.jpg',
|
||||
'durasi' => '0',
|
||||
],
|
||||
[
|
||||
'nama' => 'Pas Foto Paket 2',
|
||||
'harga' => 25000,
|
||||
'deskripsi' => 'Sesi pas foto untuk 1 orang dengan 8x shoot fotografer. Termasuk 1 file foto edit dan bebas request warna background. Paket cetak: ukuran 3x4 (8 lembar).',
|
||||
'foto' => 'img/foto/1767368572_pas-foto.jpg',
|
||||
'foto' => 'img/foto/pas-foto.jpg',
|
||||
'durasi' => '0',
|
||||
],
|
||||
[
|
||||
'nama' => 'Pas Foto Paket 3',
|
||||
'harga' => 25000,
|
||||
'deskripsi' => 'Sesi pas foto untuk 1 orang dengan 8x shoot fotografer. Termasuk 1 file foto edit dan bebas request warna background. Paket cetak: ukuran 4x6 (4 lembar).',
|
||||
'foto' => 'img/foto/1767368572_pas-foto.jpg',
|
||||
'foto' => 'img/foto/pas-foto.jpg',
|
||||
'durasi' => '0',
|
||||
],
|
||||
[
|
||||
'nama' => 'Pas Foto Paket 4',
|
||||
'harga' => 25000,
|
||||
'deskripsi' => 'Sesi pas foto untuk 1 orang dengan 8x shoot fotografer. Termasuk 1 file foto edit dan bebas request warna background. Paket cetak campur: ukuran 4x6 (2 lembar), 3x4 (3 lembar), dan 2x3 (4 lembar).',
|
||||
'foto' => 'img/foto/1767368572_pas-foto.jpg',
|
||||
'foto' => 'img/foto/pas-foto.jpg',
|
||||
'durasi' => '0',
|
||||
],
|
||||
[
|
||||
'nama' => 'Background Biru',
|
||||
'harga' => 95000,
|
||||
'deskripsi' => 'Paket foto untuk 2 orang. Termasuk: Max 10x shoot fotografer (formal), 10 menit self-photo (bebas), dan semua file dikirim via Google Drive. Cetak 2 Foto (4R) terdiri dari: (2x3) 8 lembar, (3x4) 6 lembar, dan (4x6) 4 lembar.',
|
||||
'foto' => 'img/foto/1766833654_latar biru 1.jpeg',
|
||||
'foto' => 'img/foto/latar-biru.jpeg',
|
||||
'durasi' => '20',
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
services:
|
||||
app:
|
||||
image: serversideup/php:8.2-fpm-nginx
|
||||
container_name: flodo-app
|
||||
restart: unless-stopped
|
||||
network_mode: host
|
||||
environment:
|
||||
- APP_ENV=production
|
||||
- APP_DEBUG=false
|
||||
- WEBROOT=/var/www/html/public
|
||||
- PHP_OPEN_BASEDIR=/var/www/html/:/tmp/:/usr/bin/
|
||||
- PUID=33
|
||||
- PGID=33
|
||||
- PORT=8081
|
||||
- FPM_PORT=9001
|
||||
volumes:
|
||||
- /www/wwwroot/flodo.web.id:/var/www/html:ro
|
||||
- /www/wwwroot/flodo.web.id/storage:/var/www/html/storage:rw
|
||||
- /www/wwwroot/flodo.web.id/bootstrap/cache:/var/www/html/bootstrap/cache:rw
|
||||
|
|
@ -1,13 +1,21 @@
|
|||
version: '3.8'
|
||||
|
||||
services:
|
||||
app:
|
||||
container_name: flodo-container
|
||||
build: .
|
||||
image: serversideup/php:8.2-fpm-nginx
|
||||
container_name: flodo-app
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8081:80"
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
env_file:
|
||||
- .env
|
||||
network_mode: host
|
||||
environment:
|
||||
- APP_ENV=production
|
||||
- APP_DEBUG=false
|
||||
- WEBROOT=/var/www/html/public
|
||||
- PHP_OPEN_BASEDIR=/var/www/html/:/tmp/:/usr/bin/
|
||||
- PUID=33
|
||||
- PGID=33
|
||||
- PORT=8081
|
||||
- FPM_PORT=9001
|
||||
volumes:
|
||||
- /www/wwwroot/flodo.web.id:/var/www/html:ro
|
||||
- /www/wwwroot/flodo.web.id/storage:/var/www/html/storage:rw
|
||||
- /www/wwwroot/flodo.web.id/bootstrap/cache:/var/www/html/bootstrap/cache:rw
|
||||
|
||||
|
||||
|
|
@ -23850,7 +23850,15 @@ .page-item:last-child {
|
|||
margin-left: .4rem
|
||||
}
|
||||
|
||||
.table td,
|
||||
.table thead th {
|
||||
vertical-align: middle !important;
|
||||
text-align: center !important;
|
||||
/* Ini yang bikin rata tengah */
|
||||
font-size: var(--text-sm);
|
||||
font-weight: var(--fw-medium);
|
||||
}
|
||||
|
||||
/* .table td,
|
||||
.dataTable-table td {
|
||||
vertical-align: middle !important;
|
||||
font-size: var(--text-sm);
|
||||
|
|
@ -23858,12 +23866,18 @@ .dataTable-table td {
|
|||
}
|
||||
|
||||
|
||||
.table .table-striped thead th {
|
||||
vertical-align: middle !important;
|
||||
font-size: var(--text-sm);
|
||||
font-weight: var(--fw-medium);
|
||||
}
|
||||
|
||||
.table thead th,
|
||||
.dataTable-table thead th {
|
||||
vertical-align: middle !important;
|
||||
font-size: var(--text-sm);
|
||||
font-weight: var(--fw-medium);
|
||||
}
|
||||
} */
|
||||
|
||||
.table:not(.table-borderless) thead th,
|
||||
.dataTable-table:not(.table-borderless) thead th {
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 121 KiB After Width: | Height: | Size: 121 KiB |
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 101 KiB |
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 121 KiB After Width: | Height: | Size: 121 KiB |