diff --git a/app/Http/Controllers/PengembalianController.php b/app/Http/Controllers/PengembalianController.php index 5278758..c74b682 100644 --- a/app/Http/Controllers/PengembalianController.php +++ b/app/Http/Controllers/PengembalianController.php @@ -63,18 +63,32 @@ class PengembalianController extends Controller public function update(Request $request, $id) { $request->validate([ - 'asset_id' => 'required', + 'peti_id' => 'required', 'exit_at' => 'required', - 'exit_pic' => 'required', + 'est_pengembalian' => 'required', + 'exit_warehouse' => 'required', 'enter_at' => 'required', - 'enter_pic' => 'required', 'enter_warehouse' => 'required', + 'kondisi_peti' => 'required', ]); try { $peminjaman = asset_status::findOrFail($id); - $peminjaman['updated_by'] = Auth::user()->fullname; // Menambahkan ID pengguna sebagai updated_by - $peminjaman->update($request->all()); + + // Update atribut-atribut yang diperlukan + $peminjaman->enter_pic = Auth::user()->id; + $peminjaman->updated_by = Auth::user()->id; + + $peminjaman->peti_id = $request->input('peti_id'); + $peminjaman->exit_at = $request->input('exit_at'); + $peminjaman->est_pengembalian = $request->input('est_pengembalian'); + $peminjaman->exit_warehouse = $request->input('exit_warehouse'); + $peminjaman->enter_at = $request->input('enter_at'); + $peminjaman->enter_warehouse = $request->input('enter_warehouse'); + $peminjaman->kondisi_peti = $request->input('kondisi_peti'); + + // dd($peminjaman); + $peminjaman->save(); return redirect()->route('dashboard.pengembalian.index')->with('success', 'Data peminjaman berhasil diperbaharui'); } catch (\Throwable $th) { @@ -85,21 +99,29 @@ class PengembalianController extends Controller // public function update(Request $request, $id) // { + // // dd($request->all()); // $request->validate([ - // 'asset_id' => 'required', + // 'peti_id' => 'required', // 'exit_at' => 'required', - // 'exit_pic' => 'required', + // 'est_pengembalian' => 'required', + // 'exit_warehouse' => 'required', // 'enter_at' => 'required', - // 'enter_pic' => 'required', // 'enter_warehouse' => 'required', + // 'kondisi_peti' => 'required', // ]); + // // dd($request); + // try { // $peminjaman = asset_status::findOrFail($id); - // $peminjaman['updated_by'] = Auth::user()->fullname; // Menambahkan ID pengguna sebagai updated_by + // $peminjaman['enter_pic'] = Auth::user()->id; // Menambahkan ID pengguna sebagai updated_by + // $peminjaman['updated_by'] = Auth::user()->id; // Menambahkan ID pengguna sebagai updated_by + // dd($peminjaman); // $peminjaman->update($request->all()); - // return redirect()->route('pengembalian.index')->with('success', 'Data peminjaman berhasil diperbaharui'); + + // return redirect()->route('dashboard.pengembalian.index')->with('success', 'Data peminjaman berhasil diperbaharui'); // } catch (\Throwable $th) { - // return redirect()->back()->with('error', 'Data peminjaman gagal diperbaharui'); + // // Tampilkan pesan kesalahan untuk debugging + // return redirect()->back()->with('error', 'Data peminjaman gagal diperbaharui: ' . $th->getMessage()); // } // } diff --git a/app/Models/asset_status.php b/app/Models/asset_status.php index 56eca45..c931931 100644 --- a/app/Models/asset_status.php +++ b/app/Models/asset_status.php @@ -17,12 +17,12 @@ class asset_status extends Model 'peti_id', //sudah 'exit_at', //sudah 'est_pengembalian', //sudah - 'exit_pic', //sudah + 'exit_pic', // di controler 'exit_warehouse', //sudah - 'enter_at', - 'enter_pic', - 'enter_warehouse', - 'kondisi_peti', + 'enter_at', // //sudah + 'enter_pic', // //sudah + 'enter_warehouse', // //sudah + 'kondisi_peti', // //sudah 'created_by', 'updated_by', ]; diff --git a/composer.lock b/composer.lock index fec8e95..7243390 100644 --- a/composer.lock +++ b/composer.lock @@ -1811,6 +1811,7 @@ }, { "name": "lcobucci/clock", +<<<<<<< HEAD "version": "3.0.0", "source": { "type": "git", @@ -1821,11 +1822,27 @@ "type": "zip", "url": "https://api.github.com/repos/lcobucci/clock/zipball/039ef98c6b57b101d10bd11d8fdfda12cbd996dc", "reference": "039ef98c6b57b101d10bd11d8fdfda12cbd996dc", +======= + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/lcobucci/clock.git", + "reference": "c7aadcd6fd97ed9e199114269c0be3f335e38876" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lcobucci/clock/zipball/c7aadcd6fd97ed9e199114269c0be3f335e38876", + "reference": "c7aadcd6fd97ed9e199114269c0be3f335e38876", +>>>>>>> 549f8b9a361a5f1f70601f56ab3f8b0290f617ad "shasum": "" }, "require": { "php": "~8.1.0 || ~8.2.0", +<<<<<<< HEAD "psr/clock": "^1.0" +======= + "stella-maris/clock": "^0.1.7" +>>>>>>> 549f8b9a361a5f1f70601f56ab3f8b0290f617ad }, "provide": { "psr/clock-implementation": "1.0" @@ -1859,7 +1876,11 @@ "description": "Yet another clock abstraction", "support": { "issues": "https://github.com/lcobucci/clock/issues", +<<<<<<< HEAD "source": "https://github.com/lcobucci/clock/tree/3.0.0" +======= + "source": "https://github.com/lcobucci/clock/tree/2.3.0" +>>>>>>> 549f8b9a361a5f1f70601f56ab3f8b0290f617ad }, "funding": [ { @@ -1871,45 +1892,51 @@ "type": "patreon" } ], +<<<<<<< HEAD "time": "2022-12-19T15:00:24+00:00" +======= + "time": "2022-12-19T14:38:11+00:00" +>>>>>>> 549f8b9a361a5f1f70601f56ab3f8b0290f617ad }, { "name": "lcobucci/jwt", - "version": "4.3.0", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/lcobucci/jwt.git", - "reference": "4d7de2fe0d51a96418c0d04004986e410e87f6b4" + "reference": "55564265fddf810504110bd68ca311932324b0e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lcobucci/jwt/zipball/4d7de2fe0d51a96418c0d04004986e410e87f6b4", - "reference": "4d7de2fe0d51a96418c0d04004986e410e87f6b4", + "url": "https://api.github.com/repos/lcobucci/jwt/zipball/55564265fddf810504110bd68ca311932324b0e9", + "reference": "55564265fddf810504110bd68ca311932324b0e9", "shasum": "" }, "require": { - "ext-hash": "*", - "ext-json": "*", "ext-mbstring": "*", "ext-openssl": "*", - "ext-sodium": "*", - "lcobucci/clock": "^2.0 || ^3.0", + "lcobucci/clock": "^2.0", "php": "^7.4 || ^8.0" }, "require-dev": { - "infection/infection": "^0.21", + "infection/infection": "^0.20", "lcobucci/coding-standard": "^6.0", - "mikey179/vfsstream": "^1.6.7", - "phpbench/phpbench": "^1.2", + "mikey179/vfsstream": "^1.6", + "phpbench/phpbench": "^0.17", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1.0", - "phpstan/phpstan-strict-rules": "^1.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-deprecation-rules": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", "phpunit/php-invoker": "^3.1", - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^9.4" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, "autoload": { "psr-4": { "Lcobucci\\JWT\\": "src" @@ -1933,7 +1960,7 @@ ], "support": { "issues": "https://github.com/lcobucci/jwt/issues", - "source": "https://github.com/lcobucci/jwt/tree/4.3.0" + "source": "https://github.com/lcobucci/jwt/tree/4.0.4" }, "funding": [ { @@ -1945,7 +1972,7 @@ "type": "patreon" } ], - "time": "2023-01-02T13:28:00+00:00" + "time": "2021-09-28T19:18:28+00:00" }, { "name": "league/commonmark", @@ -4442,6 +4469,53 @@ }, "time": "2021-02-08T20:43:55+00:00" }, + { + "name": "stella-maris/clock", + "version": "0.1.7", + "source": { + "type": "git", + "url": "https://github.com/stella-maris-solutions/clock.git", + "reference": "fa23ce16019289a18bb3446fdecd45befcdd94f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/stella-maris-solutions/clock/zipball/fa23ce16019289a18bb3446fdecd45befcdd94f8", + "reference": "fa23ce16019289a18bb3446fdecd45befcdd94f8", + "shasum": "" + }, + "require": { + "php": "^7.0|^8.0", + "psr/clock": "^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "StellaMaris\\Clock\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Heigl", + "role": "Maintainer" + } + ], + "description": "A pre-release of the proposed PSR-20 Clock-Interface", + "homepage": "https://gitlab.com/stella-maris/clock", + "keywords": [ + "clock", + "datetime", + "point in time", + "psr20" + ], + "support": { + "source": "https://github.com/stella-maris-solutions/clock/tree/0.1.7" + }, + "time": "2022-11-25T16:15:06+00:00" + }, { "name": "symfony/console", "version": "v6.3.4", diff --git a/resources/views/dashboard/Pengembalian/edit.blade.php b/resources/views/dashboard/Pengembalian/edit.blade.php index 56a9c95..2a81f87 100644 --- a/resources/views/dashboard/Pengembalian/edit.blade.php +++ b/resources/views/dashboard/Pengembalian/edit.blade.php @@ -16,63 +16,34 @@ @method('PUT')