diff --git a/app/Http/Controllers/MarhunController.php b/app/Http/Controllers/MarhunController.php index 8b9a8cac..3928cbbc 100644 --- a/app/Http/Controllers/MarhunController.php +++ b/app/Http/Controllers/MarhunController.php @@ -14,6 +14,7 @@ use App\Models\JenisKarat; use App\Models\Gadai; use App\Models\Lelong; use App\Models\CawanganLelong; +use App\Models\FileMarhun; use App\Models\LelongBid; use App\Models\LelongBidMarhun; use App\Models\LelKarat; @@ -1119,5 +1120,20 @@ class MarhunController extends Controller return view('marhun.scanbarcode'); } + public function savePhotoOverallMarhun(Request $request) { + // dump($request->gambarMarhun); + $data = base64_encode($request->gambarMarhun->get()); + $file_type = $request->gambarMarhun->extension(); + + $addfile = new FileMarhun(); + $addfile->file_type = $file_type; + $addfile->filename = $data; + $addfile->save(); + // dd($addfile); + } + + public function savePhotoEachMarhun() { + + } } diff --git a/app/Models/FileMarhun.php b/app/Models/FileMarhun.php new file mode 100644 index 00000000..85886211 --- /dev/null +++ b/app/Models/FileMarhun.php @@ -0,0 +1,20 @@ +bigIncrements('id'); + $table->unsignedBigInteger('lelongbid_id')->unsigned()->nullable(); + $table->unsignedBigInteger('lelongbidmarhun_id')->unsigned()->nullable(); + $table->string('file_type'); + $table->timestamps(); + }); + + // once the table is created use a raw query to ALTER it and add the MEDIUMBLOB + DB::statement("ALTER TABLE filemarhun ADD filename LONGBLOB"); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('filemarhun'); + } +} diff --git a/resources/views/marhun/marhun.blade.php b/resources/views/marhun/marhun.blade.php index e6473d4a..1fecce0c 100644 --- a/resources/views/marhun/marhun.blade.php +++ b/resources/views/marhun/marhun.blade.php @@ -254,24 +254,25 @@ -