File tree Expand file tree Collapse file tree 3 files changed +60
-0
lines changed Expand file tree Collapse file tree 3 files changed +60
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,12 @@ protected static function booted(): void
3030 ->copy ($ arsipSsp ,
3131 session ('year ' ).'/ ' .'arsip-dokumens ' .'/ ' .$ kakSp2d ->kerangka_acuan_id .'/SSP_ ' .DaftarSp2d::find ($ kakSp2d ->daftar_sp2d_id )->nomor_spp .'.pdf ' );
3232 }
33+ $ arsipDrpp = DaftarSp2d::find ($ kakSp2d ->daftar_sp2d_id )->arsip_drpp ;
34+ if ($ arsipDrpp ) {
35+ Storage::disk ('arsip ' )
36+ ->copy ($ arsipDrpp ,
37+ session ('year ' ).'/ ' .'arsip-dokumens ' .'/ ' .$ kakSp2d ->kerangka_acuan_id .'/DRPP_ ' .DaftarSp2d::find ($ kakSp2d ->daftar_sp2d_id )->nomor_spp .'.pdf ' );
38+ }
3339 });
3440 static ::deleting (function (KakSp2d $ kakSp2d ) {
3541 Storage::disk ('arsip ' )
@@ -42,6 +48,8 @@ protected static function booted(): void
4248 ->delete (session ('year ' ).'/ ' .'arsip-dokumens ' .'/ ' .$ kakSp2d ->kerangka_acuan_id .'/SPP_ ' .DaftarSp2d::find ($ kakSp2d ->daftar_sp2d_id )->nomor_spp .'.pdf ' );
4349 Storage::disk ('arsip ' )
4450 ->delete (session ('year ' ).'/ ' .'arsip-dokumens ' .'/ ' .$ kakSp2d ->kerangka_acuan_id .'/SSP_ ' .DaftarSp2d::find ($ kakSp2d ->daftar_sp2d_id )->nomor_spp .'.pdf ' );
51+ Storage::disk ('arsip ' )
52+ ->delete (session ('year ' ).'/ ' .'arsip-dokumens ' .'/ ' .$ kakSp2d ->kerangka_acuan_id .'/DRPP_ ' .DaftarSp2d::find ($ kakSp2d ->daftar_sp2d_id )->nomor_spp .'.pdf ' );
4553 });
4654 }
4755}
Original file line number Diff line number Diff line change @@ -163,6 +163,28 @@ public function fields(NovaRequest $request)
163163 :
164164 Text::make ('Lampiran SPM ' , fn () => null )->onlyOnDetail (),
165165
166+ Filepond::make ('DRPP ' , 'arsip_drpp ' )
167+ ->disk ('arsip ' )
168+ ->disableCredits ()
169+ ->onlyOnForms ()
170+ ->mimesTypes (['application/pdf ' ])
171+ ->creationRules ('required ' )
172+ ->path (session ('year ' ).'/ ' .static ::uriKey ().'/ ' .$ this ->nomor_spp )
173+ ->storeAs (function (Request $ request ) {
174+ $ originalName = 'DRPP_ ' .$ this ->nomor_spp ;
175+ $ extension = $ request ->arsip_drpp ->getClientOriginalExtension ();
176+
177+ return $ originalName .'_ ' .uniqid ().'. ' .$ extension ;
178+ })
179+ ->canSee (fn () => Policy::make ()->allowedFor ('arsiparis,ppspm ' )->get ())
180+ ->prunable (),
181+ $ this ->arsip_drpp ?
182+ URL ::make ('DRPP ' , fn () => Storage::disk ('arsip ' )
183+ ->url ($ this ->arsip_drpp ))
184+ ->displayUsing (fn () => 'Lihat ' )->onlyOnDetail ()
185+ :
186+ Text::make ('DRPP ' , fn () => null )->onlyOnDetail (),
187+
166188 Filepond::make ('SSP ' , 'arsip_ssp ' )
167189 ->disk ('arsip ' )
168190 ->disableCredits ()
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use Illuminate \Database \Migrations \Migration ;
4+ use Illuminate \Database \Schema \Blueprint ;
5+ use Illuminate \Support \Facades \Schema ;
6+
7+ return new class extends Migration
8+ {
9+ /**
10+ * Run the migrations.
11+ */
12+ public function up (): void
13+ {
14+ Schema::table ('daftar_sp2ds ' , function (Blueprint $ table ) {
15+ $ table ->after ('arsip_lampiran ' , function (Blueprint $ table ) {
16+ $ table ->string ('arsip_drpp ' )->nullable ();
17+ });
18+ });
19+ }
20+
21+ /**
22+ * Reverse the migrations.
23+ */
24+ public function down (): void
25+ {
26+ Schema::table ('daftar_sp2ds ' , function (Blueprint $ table ) {
27+ $ table ->dropColumn ('arsip_drpp ' );
28+ });
29+ }
30+ };
You can’t perform that action at this time.
0 commit comments