From e950b73b44387be2750cb073c52eafc5a1e49277 Mon Sep 17 00:00:00 2001 From: Daeng Deni Mardaeni Date: Tue, 13 Aug 2024 11:54:42 +0700 Subject: [PATCH] Optimize code --- app/Exports/BranchExport.php | 5 +- app/Exports/CurrencyExport.php | 8 +- app/Exports/JenisAsetExport.php | 5 +- app/Exports/JenisFasilitasKreditExport.php | 5 +- app/Exports/JenisJaminanExport.php | 5 +- app/Http/Controllers/BranchController.php | 7 +- app/Http/Controllers/CurrencyController.php | 7 +- app/Http/Controllers/JenisAsetController.php | 7 +- .../JenisFasilitasKreditController.php | 272 +++++++++--------- .../Controllers/JenisJaminanController.php | 7 +- .../JenisLegalitasJaminanController.php | 7 +- app/Http/Requests/BranchRequest.php | 60 ++-- app/Http/Requests/JenisAsetRequest.php | 50 ++-- app/Http/Requests/JenisJaminanRequest.php | 50 ++-- .../Requests/JenisLegalitasJaminanRequest.php | 50 ++-- app/Models/Base.php | 17 +- app/Models/Branch.php | 21 +- app/Models/Currency.php | 24 +- app/Models/JenisAset.php | 16 +- app/Models/JenisFasilitasKredit.php | 12 +- app/Models/JenisJaminan.php | 16 +- app/Models/JenisLegalitasJaminan.php | 16 +- app/Providers/EventServiceProvider.php | 50 ++-- app/Providers/LpjServiceProvider.php | 233 +++++++-------- app/Providers/RouteServiceProvider.php | 82 +++--- config/config.php | 6 +- ...51_create_jenis_fasilitas_kredit_table.php | 64 +++-- ...8_11_000110_create_jenis_jaminan_table.php | 64 +++-- ...8_create_jenis_legalitas_jaminan_table.php | 64 +++-- ...4_08_11_074816_create_jenis_aset_table.php | 64 +++-- ...024_08_12_023807_create_branches_table.php | 67 ++--- ...4_08_12_024448_create_currencies_table.php | 69 ++--- database/seeders/LpjDatabaseSeeder.php | 21 +- package.json | 26 +- resources/views/branch/create.blade.php | 88 +++--- resources/views/currency/create.blade.php | 110 +++---- resources/views/jenis_aset/create.blade.php | 88 +++--- .../jenis_fasilitas_kredit/create.blade.php | 88 +++--- .../views/jenis_jaminan/create.blade.php | 88 +++--- .../jenis_legalitas_jaminan/create.blade.php | 88 +++--- routes/api.php | 24 +- vite.config.js | 4 +- 42 files changed, 1064 insertions(+), 991 deletions(-) diff --git a/app/Exports/BranchExport.php b/app/Exports/BranchExport.php index 9ec3dd8..1de8ebf 100644 --- a/app/Exports/BranchExport.php +++ b/app/Exports/BranchExport.php @@ -7,6 +7,7 @@ use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithMapping; use Modules\Lpj\Models\Branch; + use PhpOffice\PhpSpreadsheet\Style\NumberFormat; class BranchExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping { @@ -41,8 +42,8 @@ : array { return [ - 'A' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER, - 'D' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME + 'A' => NumberFormat::FORMAT_NUMBER, + 'D' => NumberFormat::FORMAT_DATE_DATETIME ]; } } diff --git a/app/Exports/CurrencyExport.php b/app/Exports/CurrencyExport.php index 8b9f6d3..27a73cb 100644 --- a/app/Exports/CurrencyExport.php +++ b/app/Exports/CurrencyExport.php @@ -7,7 +7,7 @@ use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithMapping; use Modules\Lpj\Models\Currency; - use Modules\Lpj\Models\JenisJaminan; + use PhpOffice\PhpSpreadsheet\Style\NumberFormat; class CurrencyExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping { @@ -46,9 +46,9 @@ : array { return [ - 'A' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER, - 'B' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER, - 'E' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME + 'A' => NumberFormat::FORMAT_NUMBER, + 'B' => NumberFormat::FORMAT_NUMBER, + 'E' => NumberFormat::FORMAT_DATE_DATETIME ]; } } diff --git a/app/Exports/JenisAsetExport.php b/app/Exports/JenisAsetExport.php index 158d4f0..449b73e 100644 --- a/app/Exports/JenisAsetExport.php +++ b/app/Exports/JenisAsetExport.php @@ -7,6 +7,7 @@ use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithMapping; use Modules\Lpj\Models\JenisAset; + use PhpOffice\PhpSpreadsheet\Style\NumberFormat; class JenisAsetExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping { @@ -41,8 +42,8 @@ : array { return [ - 'A' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER, - 'D' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME + 'A' => NumberFormat::FORMAT_NUMBER, + 'D' => NumberFormat::FORMAT_DATE_DATETIME ]; } } diff --git a/app/Exports/JenisFasilitasKreditExport.php b/app/Exports/JenisFasilitasKreditExport.php index 1a61a90..7341e64 100644 --- a/app/Exports/JenisFasilitasKreditExport.php +++ b/app/Exports/JenisFasilitasKreditExport.php @@ -7,6 +7,7 @@ use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithMapping; use Modules\Lpj\Models\JenisFasilitasKredit; + use PhpOffice\PhpSpreadsheet\Style\NumberFormat; class JenisFasilitasKreditExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping { @@ -41,8 +42,8 @@ : array { return [ - 'A' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER, - 'D' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME + 'A' => NumberFormat::FORMAT_NUMBER, + 'D' => NumberFormat::FORMAT_DATE_DATETIME ]; } } diff --git a/app/Exports/JenisJaminanExport.php b/app/Exports/JenisJaminanExport.php index cfbc234..9d313d0 100644 --- a/app/Exports/JenisJaminanExport.php +++ b/app/Exports/JenisJaminanExport.php @@ -7,6 +7,7 @@ use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithMapping; use Modules\Lpj\Models\JenisJaminan; + use PhpOffice\PhpSpreadsheet\Style\NumberFormat; class JenisJaminanExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping { @@ -41,8 +42,8 @@ : array { return [ - 'A' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER, - 'D' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME + 'A' => NumberFormat::FORMAT_NUMBER, + 'D' => NumberFormat::FORMAT_DATE_DATETIME ]; } } diff --git a/app/Http/Controllers/BranchController.php b/app/Http/Controllers/BranchController.php index f990d9f..a7c20ee 100644 --- a/app/Http/Controllers/BranchController.php +++ b/app/Http/Controllers/BranchController.php @@ -3,6 +3,7 @@ namespace Modules\Lpj\Http\Controllers; use App\Http\Controllers\Controller; + use Exception; use Illuminate\Http\Request; use Maatwebsite\Excel\Facades\Excel; use Modules\Lpj\Exports\BranchExport; @@ -29,7 +30,7 @@ return redirect() ->route('basicdata.branch.index') ->with('success', 'Branch created successfully'); - } catch (\Exception $e) { + } catch (Exception $e) { return redirect() ->route('basicdata.branch.create') ->with('error', 'Failed to create branch'); @@ -60,7 +61,7 @@ return redirect() ->route('basicdata.branch.index') ->with('success', 'Branch updated successfully'); - } catch (\Exception $e) { + } catch (Exception $e) { return redirect() ->route('basicdata.branch.edit', $id) ->with('error', 'Failed to update branch'); @@ -76,7 +77,7 @@ $branch->delete(); echo json_encode(['success' => true, 'message' => 'Branch deleted successfully']); - } catch (\Exception $e) { + } catch (Exception $e) { echo json_encode(['success' => false, 'message' => 'Failed to delete branch']); } } diff --git a/app/Http/Controllers/CurrencyController.php b/app/Http/Controllers/CurrencyController.php index 147da7e..042e7af 100644 --- a/app/Http/Controllers/CurrencyController.php +++ b/app/Http/Controllers/CurrencyController.php @@ -3,6 +3,7 @@ namespace Modules\Lpj\Http\Controllers; use App\Http\Controllers\Controller; + use Exception; use Illuminate\Http\Request; use Maatwebsite\Excel\Facades\Excel; use Modules\Lpj\Exports\CurrencyExport; @@ -29,7 +30,7 @@ return redirect() ->route('basicdata.currency.index') ->with('success', 'Currency created successfully'); - } catch (\Exception $e) { + } catch (Exception $e) { return redirect() ->route('basicdata.currency.create') ->with('error', 'Failed to create currency'); @@ -60,7 +61,7 @@ return redirect() ->route('basicdata.currency.index') ->with('success', 'Currency updated successfully'); - } catch (\Exception $e) { + } catch (Exception $e) { return redirect() ->route('basicdata.currency.edit', $id) ->with('error', 'Failed to update currency'); @@ -76,7 +77,7 @@ $currency->delete(); echo json_encode(['success' => true, 'message' => 'Currency deleted successfully']); - } catch (\Exception $e) { + } catch (Exception $e) { echo json_encode(['success' => false, 'message' => 'Failed to delete currency']); } } diff --git a/app/Http/Controllers/JenisAsetController.php b/app/Http/Controllers/JenisAsetController.php index 54160fc..d325645 100644 --- a/app/Http/Controllers/JenisAsetController.php +++ b/app/Http/Controllers/JenisAsetController.php @@ -3,6 +3,7 @@ namespace Modules\Lpj\Http\Controllers; use App\Http\Controllers\Controller; + use Exception; use Illuminate\Http\Request; use Maatwebsite\Excel\Facades\Excel; use Modules\Lpj\Exports\JenisAsetExport; @@ -29,7 +30,7 @@ return redirect() ->route('basicdata.jenis-aset.index') ->with('success', 'Jenis Aset created successfully'); - } catch (\Exception $e) { + } catch (Exception $e) { return redirect() ->route('basicdata.jenis-aset.create') ->with('error', 'Failed to create jenis aset'); @@ -60,7 +61,7 @@ return redirect() ->route('basicdata.jenis-aset.index') ->with('success', 'Jenis Aset updated successfully'); - } catch (\Exception $e) { + } catch (Exception $e) { return redirect() ->route('basicdata.jenis-aset.edit', $id) ->with('error', 'Failed to update jenis aset'); @@ -76,7 +77,7 @@ $jenisAset->delete(); echo json_encode(['success' => true, 'message' => 'Jenis Aset deleted successfully']); - } catch (\Exception $e) { + } catch (Exception $e) { echo json_encode(['success' => false, 'message' => 'Failed to delete jenis aset']); } } diff --git a/app/Http/Controllers/JenisFasilitasKreditController.php b/app/Http/Controllers/JenisFasilitasKreditController.php index facd7bc..59b481d 100644 --- a/app/Http/Controllers/JenisFasilitasKreditController.php +++ b/app/Http/Controllers/JenisFasilitasKreditController.php @@ -1,134 +1,150 @@ validated(); - - if($validate){ - try{ - // Save to database - JenisFasilitasKredit::create($validate); - return redirect()->route('basicdata.jenis-fasilitas-kredit.index')->with('success', 'Jenis Fasilitas Kredit created successfully'); - } catch (\Exception $e){ - return redirect()->route('basicdata.jenis-fasilitas-kredit.create')->with('error', 'Failed to create jenis fasilitas kredit'); - } - } - } - - public function edit($id){ - $jenisFasilitasKredit = JenisFasilitasKredit::find($id); - return view('lpj::jenis_fasilitas_kredit.create', compact('jenisFasilitasKredit')); - } - - public function update(JenisFasilitasKreditRequest $request, $id){ - $validate = $request->validated(); - - if($validate){ - try{ - // Update in database - $jenisFasilitasKredit = JenisFasilitasKredit::find($id); - $jenisFasilitasKredit->update($validate); - return redirect()->route('basicdata.jenis-fasilitas-kredit.index')->with('success', 'Jenis Fasilitas Kredit updated successfully'); - } catch (\Exception $e){ - return redirect()->route('basicdata.jenis-fasilitas-kredit.edit', $id)->with('error', 'Failed to update jenis fasilitas kredit'); - } - } - } - - public function destroy($id){ - try{ - // Delete from database - $jenisFasilitasKredit = JenisFasilitasKredit::find($id); - $jenisFasilitasKredit->delete(); - - echo json_encode(['success' => true, 'message' => 'Jenis Fasilitas Kredit deleted successfully']); - } catch (\Exception $e){ - echo json_encode(['success' => false, 'message' => 'Failed to delete jenis fasilitas kredit']); - } - } - - public function dataForDatatables(Request $request){ - if (is_null($this->user) || !$this->user->can('jenis_fasilitas_kredit.view')) { - //abort(403, 'Sorry! You are not allowed to view users.'); - } - - // Retrieve data from the database - $query = JenisFasilitasKredit::query(); - - // Apply search filter if provided - if ($request->has('search') && !empty($request->get('search'))) { - $search = $request->get('search'); - $query->where(function ($q) use ($search) { - $q->where('code', 'LIKE', "%$search%"); - $q->orWhere('name', 'LIKE', "%$search%"); - }); - } - - // Apply sorting if provided - if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) { - $order = $request->get('sortOrder'); - $column = $request->get('sortField'); - $query->orderBy($column, $order); - } - - // Get the total count of records - $totalRecords = $query->count(); - - // Apply pagination if provided - if ($request->has('page') && $request->has('size')) { - $page = $request->get('page'); - $size = $request->get('size'); - $offset = ($page - 1) * $size; // Calculate the offset - - $query->skip($offset)->take($size); - } - - // Get the filtered count of records - $filteredRecords = $query->count(); - - // Get the data for the current page - $data = $query->get(); - - // Calculate the page count - $pageCount = ceil($totalRecords/$request->get('size')); - - // Calculate the current page number - $currentPage = 0 + 1; - - // Return the response data as a JSON object - return response()->json([ - 'draw' => $request->get('draw'), - 'recordsTotal' => $totalRecords, - 'recordsFiltered' => $filteredRecords, - 'pageCount' => $pageCount, - 'page' => $currentPage, - 'totalCount' => $totalRecords, - 'data' => $data, - ]); - } - - public function export() + class JenisFasilitasKreditController extends Controller { - return Excel::download(new JenisFasilitasKreditExport, 'jenis_fasilitas_kredit.xlsx'); + public $user; + + public function index() + { + return view('lpj::jenis_fasilitas_kredit.index'); + } + + public function store(JenisFasilitasKreditRequest $request) + { + $validate = $request->validated(); + + if ($validate) { + try { + // Save to database + JenisFasilitasKredit::create($validate); + return redirect() + ->route('basicdata.jenis-fasilitas-kredit.index') + ->with('success', 'Jenis Fasilitas Kredit created successfully'); + } catch (Exception $e) { + return redirect() + ->route('basicdata.jenis-fasilitas-kredit.create') + ->with('error', 'Failed to create jenis fasilitas kredit'); + } + } + } + + public function create() + { + return view('lpj::jenis_fasilitas_kredit.create'); + } + + public function edit($id) + { + $jenisFasilitasKredit = JenisFasilitasKredit::find($id); + return view('lpj::jenis_fasilitas_kredit.create', compact('jenisFasilitasKredit')); + } + + public function update(JenisFasilitasKreditRequest $request, $id) + { + $validate = $request->validated(); + + if ($validate) { + try { + // Update in database + $jenisFasilitasKredit = JenisFasilitasKredit::find($id); + $jenisFasilitasKredit->update($validate); + return redirect() + ->route('basicdata.jenis-fasilitas-kredit.index') + ->with('success', 'Jenis Fasilitas Kredit updated successfully'); + } catch (Exception $e) { + return redirect() + ->route('basicdata.jenis-fasilitas-kredit.edit', $id) + ->with('error', 'Failed to update jenis fasilitas kredit'); + } + } + } + + public function destroy($id) + { + try { + // Delete from database + $jenisFasilitasKredit = JenisFasilitasKredit::find($id); + $jenisFasilitasKredit->delete(); + + echo json_encode(['success' => true, 'message' => 'Jenis Fasilitas Kredit deleted successfully']); + } catch (Exception $e) { + echo json_encode(['success' => false, 'message' => 'Failed to delete jenis fasilitas kredit']); + } + } + + public function dataForDatatables(Request $request) + { + if (is_null($this->user) || !$this->user->can('jenis_fasilitas_kredit.view')) { + //abort(403, 'Sorry! You are not allowed to view users.'); + } + + // Retrieve data from the database + $query = JenisFasilitasKredit::query(); + + // Apply search filter if provided + if ($request->has('search') && !empty($request->get('search'))) { + $search = $request->get('search'); + $query->where(function ($q) use ($search) { + $q->where('code', 'LIKE', "%$search%"); + $q->orWhere('name', 'LIKE', "%$search%"); + }); + } + + // Apply sorting if provided + if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) { + $order = $request->get('sortOrder'); + $column = $request->get('sortField'); + $query->orderBy($column, $order); + } + + // Get the total count of records + $totalRecords = $query->count(); + + // Apply pagination if provided + if ($request->has('page') && $request->has('size')) { + $page = $request->get('page'); + $size = $request->get('size'); + $offset = ($page - 1) * $size; // Calculate the offset + + $query->skip($offset)->take($size); + } + + // Get the filtered count of records + $filteredRecords = $query->count(); + + // Get the data for the current page + $data = $query->get(); + + // Calculate the page count + $pageCount = ceil($totalRecords / $request->get('size')); + + // Calculate the current page number + $currentPage = 0 + 1; + + // Return the response data as a JSON object + return response()->json([ + 'draw' => $request->get('draw'), + 'recordsTotal' => $totalRecords, + 'recordsFiltered' => $filteredRecords, + 'pageCount' => $pageCount, + 'page' => $currentPage, + 'totalCount' => $totalRecords, + 'data' => $data, + ]); + } + + public function export() + { + return Excel::download(new JenisFasilitasKreditExport, 'jenis_fasilitas_kredit.xlsx'); + } } -} diff --git a/app/Http/Controllers/JenisJaminanController.php b/app/Http/Controllers/JenisJaminanController.php index 11a48a3..f9736d2 100644 --- a/app/Http/Controllers/JenisJaminanController.php +++ b/app/Http/Controllers/JenisJaminanController.php @@ -3,6 +3,7 @@ namespace Modules\Lpj\Http\Controllers; use App\Http\Controllers\Controller; + use Exception; use Illuminate\Http\Request; use Maatwebsite\Excel\Facades\Excel; use Modules\Lpj\Exports\JenisJaminanExport; @@ -29,7 +30,7 @@ return redirect() ->route('basicdata.jenis-jaminan.index') ->with('success', 'Jenis Jaminan created successfully'); - } catch (\Exception $e) { + } catch (Exception $e) { return redirect() ->route('basicdata.jenis-jaminan.create') ->with('error', 'Failed to create jenis jaminan'); @@ -60,7 +61,7 @@ return redirect() ->route('basicdata.jenis-jaminan.index') ->with('success', 'Jenis Jaminan updated successfully'); - } catch (\Exception $e) { + } catch (Exception $e) { return redirect() ->route('basicdata.jenis-jaminan.edit', $id) ->with('error', 'Failed to update jenis jaminan'); @@ -76,7 +77,7 @@ $jenisJaminan->delete(); echo json_encode(['success' => true, 'message' => 'Jenis Jaminan deleted successfully']); - } catch (\Exception $e) { + } catch (Exception $e) { echo json_encode(['success' => false, 'message' => 'Failed to delete jenis jaminan']); } } diff --git a/app/Http/Controllers/JenisLegalitasJaminanController.php b/app/Http/Controllers/JenisLegalitasJaminanController.php index 8a93c1b..9c6f4e9 100644 --- a/app/Http/Controllers/JenisLegalitasJaminanController.php +++ b/app/Http/Controllers/JenisLegalitasJaminanController.php @@ -3,6 +3,7 @@ namespace Modules\Lpj\Http\Controllers; use App\Http\Controllers\Controller; + use Exception; use Illuminate\Http\Request; use Maatwebsite\Excel\Facades\Excel; use Modules\Lpj\Exports\JenisLegalitasJaminanExport; @@ -29,7 +30,7 @@ return redirect() ->route('basicdata.jenis-legalitas-jaminan.index') ->with('success', 'Jenis Legalitas Jaminan created successfully'); - } catch (\Exception $e) { + } catch (Exception $e) { return redirect() ->route('basicdata.jenis-legalitas-jaminan.create') ->with('error', 'Failed to create jenis legalitas jaminan'); @@ -60,7 +61,7 @@ return redirect() ->route('basicdata.jenis-legalitas-jaminan.index') ->with('success', 'Jenis Legalitas Jaminan updated successfully'); - } catch (\Exception $e) { + } catch (Exception $e) { return redirect() ->route('basicdata.jenis-legalitas-jaminan.edit', $id) ->with('error', 'Failed to update jenis legalitas jaminan'); @@ -76,7 +77,7 @@ $jenisLegalitasJaminan->delete(); echo json_encode(['success' => true, 'message' => 'Jenis Legalitas Jaminan deleted successfully']); - } catch (\Exception $e) { + } catch (Exception $e) { echo json_encode(['success' => false, 'message' => 'Failed to delete jenis legalitas jaminan']); } } diff --git a/app/Http/Requests/BranchRequest.php b/app/Http/Requests/BranchRequest.php index 353657c..ddc2978 100644 --- a/app/Http/Requests/BranchRequest.php +++ b/app/Http/Requests/BranchRequest.php @@ -1,38 +1,40 @@ 'required|string|max:255', - 'status' => 'nullable|boolean', - 'authorized_at' => 'nullable|datetime', - 'authorized_status' => 'nullable|string|max:1', - 'authorized_by' => 'nullable|exists:users,id', - ]; + /** + * Get the validation rules that apply to the request. + */ + public function rules() + : array + { + $rules = [ + 'name' => 'required|string|max:255', + 'status' => 'nullable|boolean', + 'authorized_at' => 'nullable|datetime', + 'authorized_status' => 'nullable|string|max:1', + 'authorized_by' => 'nullable|exists:users,id', + ]; - if ($this->method() == 'PUT') { - $rules['code'] = 'required|string|max:3|unique:branches,code,' . $this->id; - } else { - $rules['code'] = 'required|string|max:3|unique:branches,code'; + if ($this->method() == 'PUT') { + $rules['code'] = 'required|string|max:3|unique:branches,code,' . $this->id; + } else { + $rules['code'] = 'required|string|max:3|unique:branches,code'; + } + + return $rules; } - return $rules; + /** + * Determine if the user is authorized to make this request. + */ + public function authorize() + : bool + { + return true; + } } - - /** - * Determine if the user is authorized to make this request. - */ - public function authorize(): bool - { - return true; - } -} diff --git a/app/Http/Requests/JenisAsetRequest.php b/app/Http/Requests/JenisAsetRequest.php index 05c6864..2675da2 100644 --- a/app/Http/Requests/JenisAsetRequest.php +++ b/app/Http/Requests/JenisAsetRequest.php @@ -1,33 +1,35 @@ 'required|max:255', - ]; + /** + * Get the validation rules that apply to the request. + */ + public function rules() + : array + { + $rules = [ + 'name' => 'required|max:255', + ]; - if ($this->method() == 'PUT') { - $rules['code'] = 'required|max:50|unique:jenis_aset,code,' . $this->id; - } else { - $rules['code'] = 'required|max:50|unique:jenis_aset,code'; + if ($this->method() == 'PUT') { + $rules['code'] = 'required|max:50|unique:jenis_aset,code,' . $this->id; + } else { + $rules['code'] = 'required|max:50|unique:jenis_aset,code'; + } + return $rules; } - return $rules; - } - /** - * Determine if the user is authorized to make this request. - */ - public function authorize(): bool - { - return true; + /** + * Determine if the user is authorized to make this request. + */ + public function authorize() + : bool + { + return true; + } } -} diff --git a/app/Http/Requests/JenisJaminanRequest.php b/app/Http/Requests/JenisJaminanRequest.php index d008cf9..4e2da8f 100644 --- a/app/Http/Requests/JenisJaminanRequest.php +++ b/app/Http/Requests/JenisJaminanRequest.php @@ -1,33 +1,35 @@ 'required|max:255', - ]; + /** + * Get the validation rules that apply to the request. + */ + public function rules() + : array + { + $rules = [ + 'name' => 'required|max:255', + ]; - if ($this->method() == 'PUT') { - $rules['code'] = 'required|max:50|unique:jenis_jaminan,code,' . $this->id; - } else { - $rules['code'] = 'required|max:50|unique:jenis_jaminan,code'; + if ($this->method() == 'PUT') { + $rules['code'] = 'required|max:50|unique:jenis_jaminan,code,' . $this->id; + } else { + $rules['code'] = 'required|max:50|unique:jenis_jaminan,code'; + } + return $rules; } - return $rules; - } - /** - * Determine if the user is authorized to make this request. - */ - public function authorize(): bool - { - return true; + /** + * Determine if the user is authorized to make this request. + */ + public function authorize() + : bool + { + return true; + } } -} diff --git a/app/Http/Requests/JenisLegalitasJaminanRequest.php b/app/Http/Requests/JenisLegalitasJaminanRequest.php index e109b27..b319443 100644 --- a/app/Http/Requests/JenisLegalitasJaminanRequest.php +++ b/app/Http/Requests/JenisLegalitasJaminanRequest.php @@ -1,33 +1,35 @@ 'required|max:255', - ]; + /** + * Get the validation rules that apply to the request. + */ + public function rules() + : array + { + $rules = [ + 'name' => 'required|max:255', + ]; - if ($this->method() == 'PUT') { - $rules['code'] = 'required|max:50|unique:jenis_legalitas_jaminan,code,' . $this->id; - } else { - $rules['code'] = 'required|max:50|unique:jenis_legalitas_jaminan,code'; + if ($this->method() == 'PUT') { + $rules['code'] = 'required|max:50|unique:jenis_legalitas_jaminan,code,' . $this->id; + } else { + $rules['code'] = 'required|max:50|unique:jenis_legalitas_jaminan,code'; + } + return $rules; } - return $rules; - } - /** - * Determine if the user is authorized to make this request. - */ - public function authorize(): bool - { - return true; + /** + * Determine if the user is authorized to make this request. + */ + public function authorize() + : bool + { + return true; + } } -} diff --git a/app/Models/Base.php b/app/Models/Base.php index 644d6f0..eb7b4d8 100644 --- a/app/Models/Base.php +++ b/app/Models/Base.php @@ -1,14 +1,15 @@ connection = $module->database; diff --git a/app/Models/Branch.php b/app/Models/Branch.php index 405d749..836cca5 100644 --- a/app/Models/Branch.php +++ b/app/Models/Branch.php @@ -1,13 +1,16 @@ hasMany(Debiture::class, 'branch_id', 'id'); + } + } diff --git a/app/Models/Currency.php b/app/Models/Currency.php index 6fafc3f..454c834 100644 --- a/app/Models/Currency.php +++ b/app/Models/Currency.php @@ -1,14 +1,20 @@ > - */ - protected $listen = []; - - /** - * Indicates if events should be discovered. - * - * @var bool - */ - protected static $shouldDiscoverEvents = true; - - /** - * Configure the proper event listeners for email verification. - * - * @return void - */ - protected function configureEmailVerification(): void + class EventServiceProvider extends ServiceProvider { + /** + * Indicates if events should be discovered. + * + * @var bool + */ + protected static $shouldDiscoverEvents = true; + /** + * The event handler mappings for the application. + * + * @var array> + */ + protected $listen = []; + /** + * Configure the proper event listeners for email verification. + * + * @return void + */ + protected function configureEmailVerification() + : void + { + + } } -} diff --git a/app/Providers/LpjServiceProvider.php b/app/Providers/LpjServiceProvider.php index c000e93..474ae18 100644 --- a/app/Providers/LpjServiceProvider.php +++ b/app/Providers/LpjServiceProvider.php @@ -1,124 +1,133 @@ registerCommands(); - $this->registerCommandSchedules(); - $this->registerTranslations(); - $this->registerConfig(); - $this->registerViews(); - $this->loadMigrationsFrom(module_path($this->moduleName, 'database/migrations')); + protected string $moduleName = 'Lpj'; - if (class_exists('Breadcrumbs')) { - require __DIR__ . '/../../routes/breadcrumbs.php'; - } - } + protected string $moduleNameLower = 'lpj'; - /** - * Register the service provider. - */ - public function register(): void - { - $this->app->register(EventServiceProvider::class); - $this->app->register(RouteServiceProvider::class); - } + /** + * Boot the application events. + */ + public function boot() + : void + { + $this->registerCommands(); + $this->registerCommandSchedules(); + $this->registerTranslations(); + $this->registerConfig(); + $this->registerViews(); + $this->loadMigrationsFrom(module_path($this->moduleName, 'database/migrations')); - /** - * Register commands in the format of Command::class - */ - protected function registerCommands(): void - { - // $this->commands([]); - } - - /** - * Register command Schedules. - */ - protected function registerCommandSchedules(): void - { - // $this->app->booted(function () { - // $schedule = $this->app->make(Schedule::class); - // $schedule->command('inspire')->hourly(); - // }); - } - - /** - * Register translations. - */ - public function registerTranslations(): void - { - $langPath = resource_path('lang/modules/'.$this->moduleNameLower); - - if (is_dir($langPath)) { - $this->loadTranslationsFrom($langPath, $this->moduleNameLower); - $this->loadJsonTranslationsFrom($langPath); - } else { - $this->loadTranslationsFrom(module_path($this->moduleName, 'lang'), $this->moduleNameLower); - $this->loadJsonTranslationsFrom(module_path($this->moduleName, 'lang')); - } - } - - /** - * Register config. - */ - protected function registerConfig(): void - { - $this->publishes([module_path($this->moduleName, 'config/config.php') => config_path($this->moduleNameLower.'.php')], 'config'); - $this->mergeConfigFrom(module_path($this->moduleName, 'config/config.php'), $this->moduleNameLower); - } - - /** - * Register views. - */ - public function registerViews(): void - { - $viewPath = resource_path('views/modules/'.$this->moduleNameLower); - $sourcePath = module_path($this->moduleName, 'resources/views'); - - $this->publishes([$sourcePath => $viewPath], ['views', $this->moduleNameLower.'-module-views']); - - $this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower); - - $componentNamespace = str_replace('/', '\\', config('modules.namespace').'\\'.$this->moduleName.'\\'.ltrim(config('modules.paths.generator.component-class.path'), config('modules.paths.app_folder', ''))); - Blade::componentNamespace($componentNamespace, $this->moduleNameLower); - } - - /** - * Get the services provided by the provider. - * - * @return array - */ - public function provides(): array - { - return []; - } - - /** - * @return array - */ - private function getPublishableViewPaths(): array - { - $paths = []; - foreach (config('view.paths') as $path) { - if (is_dir($path.'/modules/'.$this->moduleNameLower)) { - $paths[] = $path.'/modules/'.$this->moduleNameLower; + if (class_exists('Breadcrumbs')) { + require __DIR__ . '/../../routes/breadcrumbs.php'; } } - return $paths; + /** + * Register commands in the format of Command::class + */ + protected function registerCommands() + : void + { + // $this->commands([]); + } + + /** + * Register command Schedules. + */ + protected function registerCommandSchedules() + : void + { + // $this->app->booted(function () { + // $schedule = $this->app->make(Schedule::class); + // $schedule->command('inspire')->hourly(); + // }); + } + + /** + * Register translations. + */ + public function registerTranslations() + : void + { + $langPath = resource_path('lang/modules/' . $this->moduleNameLower); + + if (is_dir($langPath)) { + $this->loadTranslationsFrom($langPath, $this->moduleNameLower); + $this->loadJsonTranslationsFrom($langPath); + } else { + $this->loadTranslationsFrom(module_path($this->moduleName, 'lang'), $this->moduleNameLower); + $this->loadJsonTranslationsFrom(module_path($this->moduleName, 'lang')); + } + } + + /** + * Register config. + */ + protected function registerConfig() + : void + { + $this->publishes([module_path($this->moduleName, 'config/config.php') => config_path($this->moduleNameLower . '.php')], 'config'); + $this->mergeConfigFrom(module_path($this->moduleName, 'config/config.php'), $this->moduleNameLower); + } + + /** + * Register views. + */ + public function registerViews() + : void + { + $viewPath = resource_path('views/modules/' . $this->moduleNameLower); + $sourcePath = module_path($this->moduleName, 'resources/views'); + + $this->publishes([$sourcePath => $viewPath], ['views', $this->moduleNameLower . '-module-views']); + + $this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower); + + $componentNamespace = str_replace('/', '\\', config('modules.namespace') . '\\' . $this->moduleName . '\\' . ltrim(config('modules.paths.generator.component-class.path'), config('modules.paths.app_folder', ''))); + Blade::componentNamespace($componentNamespace, $this->moduleNameLower); + } + + /** + * @return array + */ + private function getPublishableViewPaths() + : array + { + $paths = []; + foreach (config('view.paths') as $path) { + if (is_dir($path . '/modules/' . $this->moduleNameLower)) { + $paths[] = $path . '/modules/' . $this->moduleNameLower; + } + } + + return $paths; + } + + /** + * Register the service provider. + */ + public function register() + : void + { + $this->app->register(EventServiceProvider::class); + $this->app->register(RouteServiceProvider::class); + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() + : array + { + return []; + } } -} diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index f15ea30..62b9944 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -1,49 +1,53 @@ mapApiRoutes(); + /** + * Define the routes for the application. + */ + public function map() + : void + { + $this->mapApiRoutes(); - $this->mapWebRoutes(); - } + $this->mapWebRoutes(); + } - /** - * Define the "web" routes for the application. - * - * These routes all receive session state, CSRF protection, etc. - */ - protected function mapWebRoutes(): void - { - Route::middleware('web')->group(module_path('Lpj', '/routes/web.php')); - } + /** + * Define the "api" routes for the application. + * + * These routes are typically stateless. + */ + protected function mapApiRoutes() + : void + { + Route::middleware('api')->prefix('api')->name('api.')->group(module_path('Lpj', '/routes/api.php')); + } - /** - * Define the "api" routes for the application. - * - * These routes are typically stateless. - */ - protected function mapApiRoutes(): void - { - Route::middleware('api')->prefix('api')->name('api.')->group(module_path('Lpj', '/routes/api.php')); + /** + * Define the "web" routes for the application. + * + * These routes all receive session state, CSRF protection, etc. + */ + protected function mapWebRoutes() + : void + { + Route::middleware('web')->group(module_path('Lpj', '/routes/web.php')); + } } -} diff --git a/config/config.php b/config/config.php index a4b4610..a08a121 100644 --- a/config/config.php +++ b/config/config.php @@ -1,5 +1,5 @@ 'Lpj', -]; + return [ + 'name' => 'Lpj', + ]; diff --git a/database/migrations/2024_08_11_000051_create_jenis_fasilitas_kredit_table.php b/database/migrations/2024_08_11_000051_create_jenis_fasilitas_kredit_table.php index 82b50ee..f91353e 100644 --- a/database/migrations/2024_08_11_000051_create_jenis_fasilitas_kredit_table.php +++ b/database/migrations/2024_08_11_000051_create_jenis_fasilitas_kredit_table.php @@ -1,33 +1,39 @@ id(); - $table->string('code'); - $table->string('name'); - $table->timestamps(); - $table->softDeletes(); - $table->uuid('created_by')->nullable(); - $table->uuid('updated_by')->nullable(); - $table->uuid('deleted_by')->nullable(); - }); - } + return new class extends Migration { + /** + * Run the migrations. + */ + public function up() + : void + { + Schema::create('jenis_fasilitas_kredit', function (Blueprint $table) { + $table->id(); + $table->string('code')->unique()->index(); + $table->string('name'); + $table->boolean('status')->default(true)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->char('authorized_status', 1)->nullable(); + $table->softDeletes(); - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::dropIfExists('jenis_fasilitas_kredit'); - } -}; + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down() + : void + { + Schema::dropIfExists('jenis_fasilitas_kredit'); + } + }; diff --git a/database/migrations/2024_08_11_000110_create_jenis_jaminan_table.php b/database/migrations/2024_08_11_000110_create_jenis_jaminan_table.php index 74eadf8..be31b79 100644 --- a/database/migrations/2024_08_11_000110_create_jenis_jaminan_table.php +++ b/database/migrations/2024_08_11_000110_create_jenis_jaminan_table.php @@ -1,33 +1,39 @@ id(); - $table->string('code'); - $table->string('name'); - $table->timestamps(); - $table->softDeletes(); - $table->uuid('created_by')->nullable(); - $table->uuid('updated_by')->nullable(); - $table->uuid('deleted_by')->nullable(); - }); - } + return new class extends Migration { + /** + * Run the migrations. + */ + public function up() + : void + { + Schema::create('jenis_jaminan', function (Blueprint $table) { + $table->id(); + $table->string('code')->unique()->index()(); + $table->string('name'); + $table->boolean('status')->default(true)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->char('authorized_status', 1)->nullable(); + $table->softDeletes(); - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::dropIfExists('jenis_jaminan'); - } -}; + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down() + : void + { + Schema::dropIfExists('jenis_jaminan'); + } + }; diff --git a/database/migrations/2024_08_11_000118_create_jenis_legalitas_jaminan_table.php b/database/migrations/2024_08_11_000118_create_jenis_legalitas_jaminan_table.php index a0cbe0e..35c7da9 100644 --- a/database/migrations/2024_08_11_000118_create_jenis_legalitas_jaminan_table.php +++ b/database/migrations/2024_08_11_000118_create_jenis_legalitas_jaminan_table.php @@ -1,33 +1,39 @@ id(); - $table->string('code'); - $table->string('name'); - $table->timestamps(); - $table->softDeletes(); - $table->uuid('created_by')->nullable(); - $table->uuid('updated_by')->nullable(); - $table->uuid('deleted_by')->nullable(); - }); - } + return new class extends Migration { + /** + * Run the migrations. + */ + public function up() + : void + { + Schema::create('jenis_legalitas_jaminan', function (Blueprint $table) { + $table->id(); + $table->string('code')->unique()->index(); + $table->string('name'); + $table->boolean('status')->default(true)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->char('authorized_status', 1)->nullable(); + $table->softDeletes(); - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::dropIfExists('jenis_legalitas_jaminan'); - } -}; + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down() + : void + { + Schema::dropIfExists('jenis_legalitas_jaminan'); + } + }; diff --git a/database/migrations/2024_08_11_074816_create_jenis_aset_table.php b/database/migrations/2024_08_11_074816_create_jenis_aset_table.php index d172958..e3f3a47 100644 --- a/database/migrations/2024_08_11_074816_create_jenis_aset_table.php +++ b/database/migrations/2024_08_11_074816_create_jenis_aset_table.php @@ -1,33 +1,39 @@ id(); - $table->string('code'); - $table->string('name'); - $table->timestamps(); - $table->softDeletes(); - $table->uuid('created_by')->nullable(); - $table->uuid('updated_by')->nullable(); - $table->uuid('deleted_by')->nullable(); - }); - } + return new class extends Migration { + /** + * Run the migrations. + */ + public function up() + : void + { + Schema::create('jenis_aset', function (Blueprint $table) { + $table->id(); + $table->string('code')->unique()->index(); + $table->string('name'); + $table->boolean('status')->default(true)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->char('authorized_status', 1)->nullable(); + $table->softDeletes(); - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::dropIfExists('jenis_aset'); - } -}; + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down() + : void + { + Schema::dropIfExists('jenis_aset'); + } + }; diff --git a/database/migrations/2024_08_12_023807_create_branches_table.php b/database/migrations/2024_08_12_023807_create_branches_table.php index 058080b..bf4e9a8 100644 --- a/database/migrations/2024_08_12_023807_create_branches_table.php +++ b/database/migrations/2024_08_12_023807_create_branches_table.php @@ -1,38 +1,39 @@ id(); - $table->string('code', 9)->unique(); - $table->string('name'); - $table->boolean('status')->default(true)->nullable(); - $table->timestamps(); - $table->timestamp('authorized_at')->nullable(); - $table->char('authorized_status', 1)->nullable(); - $table->softDeletes(); + return new class extends Migration { + /** + * Run the migrations. + */ + public function up() + : void + { + Schema::create('branches', function (Blueprint $table) { + $table->id(); + $table->string('code', 9)->unique(); + $table->string('name'); + $table->boolean('status')->default(true)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->char('authorized_status', 1)->nullable(); + $table->softDeletes(); - $table->unsignedBigInteger('created_by')->nullable(); - $table->unsignedBigInteger('updated_by')->nullable(); - $table->unsignedBigInteger('deleted_by')->nullable(); - $table->unsignedBigInteger('authorized_by')->nullable(); - }); - } + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + }); + } - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::dropIfExists('branches'); - } -}; + /** + * Reverse the migrations. + */ + public function down() + : void + { + Schema::dropIfExists('branches'); + } + }; diff --git a/database/migrations/2024_08_12_024448_create_currencies_table.php b/database/migrations/2024_08_12_024448_create_currencies_table.php index 24ad961..ec92b59 100644 --- a/database/migrations/2024_08_12_024448_create_currencies_table.php +++ b/database/migrations/2024_08_12_024448_create_currencies_table.php @@ -1,39 +1,40 @@ id(); - $table->string('code',3)->unique(); - $table->string('name'); - $table->integer('decimal_places')->default(2); - $table->boolean('status')->default(true)->nullable(); - $table->timestamps(); - $table->timestamp('authorized_at')->nullable(); - $table->char('authorized_status', 1)->nullable(); - $table->softDeletes(); + return new class extends Migration { + /** + * Run the migrations. + */ + public function up() + : void + { + Schema::create('currencies', function (Blueprint $table) { + $table->id(); + $table->string('code', 3)->unique(); + $table->string('name'); + $table->integer('decimal_places')->default(2); + $table->boolean('status')->default(true)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->char('authorized_status', 1)->nullable(); + $table->softDeletes(); - $table->unsignedBigInteger('created_by')->nullable(); - $table->unsignedBigInteger('updated_by')->nullable(); - $table->unsignedBigInteger('deleted_by')->nullable(); - $table->unsignedBigInteger('authorized_by')->nullable(); - }); - } + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + }); + } - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::dropIfExists('currencies'); - } -}; + /** + * Reverse the migrations. + */ + public function down() + : void + { + Schema::dropIfExists('currencies'); + } + }; diff --git a/database/seeders/LpjDatabaseSeeder.php b/database/seeders/LpjDatabaseSeeder.php index eceb570..242ef68 100644 --- a/database/seeders/LpjDatabaseSeeder.php +++ b/database/seeders/LpjDatabaseSeeder.php @@ -1,16 +1,17 @@ call([]); + /** + * Run the database seeds. + */ + public function run() + : void + { + // $this->call([]); + } } -} diff --git a/package.json b/package.json index d6fbfc8..946ad99 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { - "private": true, - "type": "module", - "scripts": { - "dev": "vite", - "build": "vite build" - }, - "devDependencies": { - "axios": "^1.1.2", - "laravel-vite-plugin": "^0.7.5", - "sass": "^1.69.5", - "postcss": "^8.3.7", - "vite": "^4.0.0" - } + "private": true, + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build" + }, + "devDependencies": { + "axios": "^1.1.2", + "laravel-vite-plugin": "^0.7.5", + "sass": "^1.69.5", + "postcss": "^8.3.7", + "vite": "^4.0.0" + } } diff --git a/resources/views/branch/create.blade.php b/resources/views/branch/create.blade.php index ede7b71..b95a38e 100644 --- a/resources/views/branch/create.blade.php +++ b/resources/views/branch/create.blade.php @@ -9,50 +9,50 @@ @if(isset($branch->id))
- @method('PUT') - @else - - @endif - @csrf -
-
-

- {{ isset($branch->id) ? 'Edit' : 'Tambah' }} Branch -

-
- Back -
-
-
-
- -
- - @error('code') - {{ $message }} - @enderror + @method('PUT') + @else + + @endif + @csrf +
+
+

+ {{ isset($branch->id) ? 'Edit' : 'Tambah' }} Branch +

+
+ Back +
+
+
+
+ +
+ + @error('code') + {{ $message }} + @enderror +
+
+
+ +
+ + @error('name') + {{ $message }} + @enderror +
+
+
+ +
+
-
-
- -
- - @error('name') - {{ $message }} - @enderror -
-
-
- -
-
-
- +
@endsection diff --git a/resources/views/currency/create.blade.php b/resources/views/currency/create.blade.php index 6c02d64..53016ec 100644 --- a/resources/views/currency/create.blade.php +++ b/resources/views/currency/create.blade.php @@ -9,61 +9,61 @@ @if(isset($currency->id))
- @method('PUT') - @else - - @endif - @csrf -
-
-

- {{ isset($currency->id) ? 'Edit' : 'Tambah' }} Currency -

-
- Back -
-
-
-
- -
- - @error('code') - {{ $message }} - @enderror + @method('PUT') + @else + + @endif + @csrf +
+
+

+ {{ isset($currency->id) ? 'Edit' : 'Tambah' }} Currency +

+
+ Back +
+
+
+
+ +
+ + @error('code') + {{ $message }} + @enderror +
+
+
+ +
+ + @error('name') + {{ $message }} + @enderror +
+
+
+ +
+ + @error('decimal_places') + {{ $message }} + @enderror +
+
+
+ +
+
-
-
- -
- - @error('name') - {{ $message }} - @enderror -
-
-
- -
- - @error('decimal_places') - {{ $message }} - @enderror -
-
-
- -
-
-
- +
@endsection diff --git a/resources/views/jenis_aset/create.blade.php b/resources/views/jenis_aset/create.blade.php index e7ed045..70f679a 100644 --- a/resources/views/jenis_aset/create.blade.php +++ b/resources/views/jenis_aset/create.blade.php @@ -9,50 +9,50 @@ @if(isset($jenisAset->id))
- @method('PUT') - @else - - @endif - @csrf -
-
-

- {{ isset($jenisAset->id) ? 'Edit' : 'Tambah' }} Jenis Aset -

-
- Back -
-
-
-
- -
- - @error('code') - {{ $message }} - @enderror + @method('PUT') + @else + + @endif + @csrf +
+
+

+ {{ isset($jenisAset->id) ? 'Edit' : 'Tambah' }} Jenis Aset +

+
+ Back +
+
+
+
+ +
+ + @error('code') + {{ $message }} + @enderror +
+
+
+ +
+ + @error('name') + {{ $message }} + @enderror +
+
+
+ +
+
-
-
- -
- - @error('name') - {{ $message }} - @enderror -
-
-
- -
-
-
- +
@endsection diff --git a/resources/views/jenis_fasilitas_kredit/create.blade.php b/resources/views/jenis_fasilitas_kredit/create.blade.php index 19a6270..c5fa3fa 100644 --- a/resources/views/jenis_fasilitas_kredit/create.blade.php +++ b/resources/views/jenis_fasilitas_kredit/create.blade.php @@ -9,50 +9,50 @@ @if(isset($jenisFasilitasKredit->id))
- @method('PUT') - @else - - @endif - @csrf -
-
-

- {{ isset($jenisFasilitasKredit->id) ? 'Edit' : 'Tambah' }} Jenis Fasilitas Kredit -

-
- Back -
-
-
-
- -
- - @error('code') - {{ $message }} - @enderror + @method('PUT') + @else + + @endif + @csrf +
+
+

+ {{ isset($jenisFasilitasKredit->id) ? 'Edit' : 'Tambah' }} Jenis Fasilitas Kredit +

+
+ Back +
+
+
+
+ +
+ + @error('code') + {{ $message }} + @enderror +
+
+
+ +
+ + @error('name') + {{ $message }} + @enderror +
+
+
+ +
+
-
-
- -
- - @error('name') - {{ $message }} - @enderror -
-
-
- -
-
-
- +
@endsection diff --git a/resources/views/jenis_jaminan/create.blade.php b/resources/views/jenis_jaminan/create.blade.php index 610c159..256a16a 100644 --- a/resources/views/jenis_jaminan/create.blade.php +++ b/resources/views/jenis_jaminan/create.blade.php @@ -9,50 +9,50 @@ @if(isset($jenisJaminan->id))
- @method('PUT') - @else - - @endif - @csrf -
-
-

- {{ isset($jenisJaminan->id) ? 'Edit' : 'Tambah' }} Jenis Jaminan -

-
- Back -
-
-
-
- -
- - @error('code') - {{ $message }} - @enderror + @method('PUT') + @else + + @endif + @csrf +
+
+

+ {{ isset($jenisJaminan->id) ? 'Edit' : 'Tambah' }} Jenis Jaminan +

+
+ Back +
+
+
+
+ +
+ + @error('code') + {{ $message }} + @enderror +
+
+
+ +
+ + @error('name') + {{ $message }} + @enderror +
+
+
+ +
+
-
-
- -
- - @error('name') - {{ $message }} - @enderror -
-
-
- -
-
-
- +
@endsection diff --git a/resources/views/jenis_legalitas_jaminan/create.blade.php b/resources/views/jenis_legalitas_jaminan/create.blade.php index e7ae9d9..8be82a0 100644 --- a/resources/views/jenis_legalitas_jaminan/create.blade.php +++ b/resources/views/jenis_legalitas_jaminan/create.blade.php @@ -9,50 +9,50 @@ @if(isset($jenisLegalitasJaminan->id))
- @method('PUT') - @else - - @endif - @csrf -
-
-

- {{ isset($jenisLegalitasJaminan->id) ? 'Edit' : 'Tambah' }} Jenis Legalitas Jaminan -

-
- Back -
-
-
-
- -
- - @error('code') - {{ $message }} - @enderror + @method('PUT') + @else + + @endif + @csrf +
+
+

+ {{ isset($jenisLegalitasJaminan->id) ? 'Edit' : 'Tambah' }} Jenis Legalitas Jaminan +

+
+ Back +
+
+
+
+ +
+ + @error('code') + {{ $message }} + @enderror +
+
+
+ +
+ + @error('name') + {{ $message }} + @enderror +
+
+
+ +
+
-
-
- -
- - @error('name') - {{ $message }} - @enderror -
-
-
- -
-
-
- +
@endsection diff --git a/routes/api.php b/routes/api.php index 0fa8999..737f4b3 100644 --- a/routes/api.php +++ b/routes/api.php @@ -1,15 +1,11 @@