Optimize code

This commit is contained in:
Daeng Deni Mardaeni 2024-08-13 11:54:42 +07:00
parent 5c4285c77e
commit e950b73b44
42 changed files with 1064 additions and 991 deletions

View File

@ -7,6 +7,7 @@
use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping; use Maatwebsite\Excel\Concerns\WithMapping;
use Modules\Lpj\Models\Branch; use Modules\Lpj\Models\Branch;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
class BranchExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping class BranchExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping
{ {
@ -41,8 +42,8 @@
: array : array
{ {
return [ return [
'A' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER, 'A' => NumberFormat::FORMAT_NUMBER,
'D' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME 'D' => NumberFormat::FORMAT_DATE_DATETIME
]; ];
} }
} }

View File

@ -7,7 +7,7 @@
use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping; use Maatwebsite\Excel\Concerns\WithMapping;
use Modules\Lpj\Models\Currency; use Modules\Lpj\Models\Currency;
use Modules\Lpj\Models\JenisJaminan; use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
class CurrencyExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping class CurrencyExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping
{ {
@ -46,9 +46,9 @@
: array : array
{ {
return [ return [
'A' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER, 'A' => NumberFormat::FORMAT_NUMBER,
'B' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER, 'B' => NumberFormat::FORMAT_NUMBER,
'E' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME 'E' => NumberFormat::FORMAT_DATE_DATETIME
]; ];
} }
} }

View File

@ -7,6 +7,7 @@
use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping; use Maatwebsite\Excel\Concerns\WithMapping;
use Modules\Lpj\Models\JenisAset; use Modules\Lpj\Models\JenisAset;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
class JenisAsetExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping class JenisAsetExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping
{ {
@ -41,8 +42,8 @@
: array : array
{ {
return [ return [
'A' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER, 'A' => NumberFormat::FORMAT_NUMBER,
'D' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME 'D' => NumberFormat::FORMAT_DATE_DATETIME
]; ];
} }
} }

View File

@ -7,6 +7,7 @@
use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping; use Maatwebsite\Excel\Concerns\WithMapping;
use Modules\Lpj\Models\JenisFasilitasKredit; use Modules\Lpj\Models\JenisFasilitasKredit;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
class JenisFasilitasKreditExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping class JenisFasilitasKreditExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping
{ {
@ -41,8 +42,8 @@
: array : array
{ {
return [ return [
'A' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER, 'A' => NumberFormat::FORMAT_NUMBER,
'D' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME 'D' => NumberFormat::FORMAT_DATE_DATETIME
]; ];
} }
} }

View File

@ -7,6 +7,7 @@
use Maatwebsite\Excel\Concerns\WithHeadings; use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping; use Maatwebsite\Excel\Concerns\WithMapping;
use Modules\Lpj\Models\JenisJaminan; use Modules\Lpj\Models\JenisJaminan;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
class JenisJaminanExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping class JenisJaminanExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping
{ {
@ -41,8 +42,8 @@
: array : array
{ {
return [ return [
'A' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_NUMBER, 'A' => NumberFormat::FORMAT_NUMBER,
'D' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME 'D' => NumberFormat::FORMAT_DATE_DATETIME
]; ];
} }
} }

View File

@ -3,6 +3,7 @@
namespace Modules\Lpj\Http\Controllers; namespace Modules\Lpj\Http\Controllers;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use Exception;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Maatwebsite\Excel\Facades\Excel; use Maatwebsite\Excel\Facades\Excel;
use Modules\Lpj\Exports\BranchExport; use Modules\Lpj\Exports\BranchExport;
@ -29,7 +30,7 @@
return redirect() return redirect()
->route('basicdata.branch.index') ->route('basicdata.branch.index')
->with('success', 'Branch created successfully'); ->with('success', 'Branch created successfully');
} catch (\Exception $e) { } catch (Exception $e) {
return redirect() return redirect()
->route('basicdata.branch.create') ->route('basicdata.branch.create')
->with('error', 'Failed to create branch'); ->with('error', 'Failed to create branch');
@ -60,7 +61,7 @@
return redirect() return redirect()
->route('basicdata.branch.index') ->route('basicdata.branch.index')
->with('success', 'Branch updated successfully'); ->with('success', 'Branch updated successfully');
} catch (\Exception $e) { } catch (Exception $e) {
return redirect() return redirect()
->route('basicdata.branch.edit', $id) ->route('basicdata.branch.edit', $id)
->with('error', 'Failed to update branch'); ->with('error', 'Failed to update branch');
@ -76,7 +77,7 @@
$branch->delete(); $branch->delete();
echo json_encode(['success' => true, 'message' => 'Branch deleted successfully']); 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']); echo json_encode(['success' => false, 'message' => 'Failed to delete branch']);
} }
} }

View File

@ -3,6 +3,7 @@
namespace Modules\Lpj\Http\Controllers; namespace Modules\Lpj\Http\Controllers;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use Exception;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Maatwebsite\Excel\Facades\Excel; use Maatwebsite\Excel\Facades\Excel;
use Modules\Lpj\Exports\CurrencyExport; use Modules\Lpj\Exports\CurrencyExport;
@ -29,7 +30,7 @@
return redirect() return redirect()
->route('basicdata.currency.index') ->route('basicdata.currency.index')
->with('success', 'Currency created successfully'); ->with('success', 'Currency created successfully');
} catch (\Exception $e) { } catch (Exception $e) {
return redirect() return redirect()
->route('basicdata.currency.create') ->route('basicdata.currency.create')
->with('error', 'Failed to create currency'); ->with('error', 'Failed to create currency');
@ -60,7 +61,7 @@
return redirect() return redirect()
->route('basicdata.currency.index') ->route('basicdata.currency.index')
->with('success', 'Currency updated successfully'); ->with('success', 'Currency updated successfully');
} catch (\Exception $e) { } catch (Exception $e) {
return redirect() return redirect()
->route('basicdata.currency.edit', $id) ->route('basicdata.currency.edit', $id)
->with('error', 'Failed to update currency'); ->with('error', 'Failed to update currency');
@ -76,7 +77,7 @@
$currency->delete(); $currency->delete();
echo json_encode(['success' => true, 'message' => 'Currency deleted successfully']); 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']); echo json_encode(['success' => false, 'message' => 'Failed to delete currency']);
} }
} }

View File

@ -3,6 +3,7 @@
namespace Modules\Lpj\Http\Controllers; namespace Modules\Lpj\Http\Controllers;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use Exception;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Maatwebsite\Excel\Facades\Excel; use Maatwebsite\Excel\Facades\Excel;
use Modules\Lpj\Exports\JenisAsetExport; use Modules\Lpj\Exports\JenisAsetExport;
@ -29,7 +30,7 @@
return redirect() return redirect()
->route('basicdata.jenis-aset.index') ->route('basicdata.jenis-aset.index')
->with('success', 'Jenis Aset created successfully'); ->with('success', 'Jenis Aset created successfully');
} catch (\Exception $e) { } catch (Exception $e) {
return redirect() return redirect()
->route('basicdata.jenis-aset.create') ->route('basicdata.jenis-aset.create')
->with('error', 'Failed to create jenis aset'); ->with('error', 'Failed to create jenis aset');
@ -60,7 +61,7 @@
return redirect() return redirect()
->route('basicdata.jenis-aset.index') ->route('basicdata.jenis-aset.index')
->with('success', 'Jenis Aset updated successfully'); ->with('success', 'Jenis Aset updated successfully');
} catch (\Exception $e) { } catch (Exception $e) {
return redirect() return redirect()
->route('basicdata.jenis-aset.edit', $id) ->route('basicdata.jenis-aset.edit', $id)
->with('error', 'Failed to update jenis aset'); ->with('error', 'Failed to update jenis aset');
@ -76,7 +77,7 @@
$jenisAset->delete(); $jenisAset->delete();
echo json_encode(['success' => true, 'message' => 'Jenis Aset deleted successfully']); 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']); echo json_encode(['success' => false, 'message' => 'Failed to delete jenis aset']);
} }
} }

View File

@ -1,134 +1,150 @@
<?php <?php
namespace Modules\Lpj\Http\Controllers; namespace Modules\Lpj\Http\Controllers;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use Illuminate\Http\Request; use Exception;
use Maatwebsite\Excel\Facades\Excel; use Illuminate\Http\Request;
use Modules\Lpj\Exports\JenisFasilitasKreditExport; use Maatwebsite\Excel\Facades\Excel;
use Modules\Lpj\Http\Requests\JenisFasilitasKreditRequest; use Modules\Lpj\Exports\JenisFasilitasKreditExport;
use Modules\Lpj\Models\JenisFasilitasKredit; use Modules\Lpj\Http\Requests\JenisFasilitasKreditRequest;
use Modules\Lpj\Models\JenisFasilitasKredit;
class JenisFasilitasKreditController extends Controller class JenisFasilitasKreditController extends Controller
{
public $user;
public function index(){
return view('lpj::jenis_fasilitas_kredit.index');
}
public function create(){
return view('lpj::jenis_fasilitas_kredit.create');
}
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 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'); 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');
}
} }
}

View File

@ -3,6 +3,7 @@
namespace Modules\Lpj\Http\Controllers; namespace Modules\Lpj\Http\Controllers;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use Exception;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Maatwebsite\Excel\Facades\Excel; use Maatwebsite\Excel\Facades\Excel;
use Modules\Lpj\Exports\JenisJaminanExport; use Modules\Lpj\Exports\JenisJaminanExport;
@ -29,7 +30,7 @@
return redirect() return redirect()
->route('basicdata.jenis-jaminan.index') ->route('basicdata.jenis-jaminan.index')
->with('success', 'Jenis Jaminan created successfully'); ->with('success', 'Jenis Jaminan created successfully');
} catch (\Exception $e) { } catch (Exception $e) {
return redirect() return redirect()
->route('basicdata.jenis-jaminan.create') ->route('basicdata.jenis-jaminan.create')
->with('error', 'Failed to create jenis jaminan'); ->with('error', 'Failed to create jenis jaminan');
@ -60,7 +61,7 @@
return redirect() return redirect()
->route('basicdata.jenis-jaminan.index') ->route('basicdata.jenis-jaminan.index')
->with('success', 'Jenis Jaminan updated successfully'); ->with('success', 'Jenis Jaminan updated successfully');
} catch (\Exception $e) { } catch (Exception $e) {
return redirect() return redirect()
->route('basicdata.jenis-jaminan.edit', $id) ->route('basicdata.jenis-jaminan.edit', $id)
->with('error', 'Failed to update jenis jaminan'); ->with('error', 'Failed to update jenis jaminan');
@ -76,7 +77,7 @@
$jenisJaminan->delete(); $jenisJaminan->delete();
echo json_encode(['success' => true, 'message' => 'Jenis Jaminan deleted successfully']); 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']); echo json_encode(['success' => false, 'message' => 'Failed to delete jenis jaminan']);
} }
} }

View File

@ -3,6 +3,7 @@
namespace Modules\Lpj\Http\Controllers; namespace Modules\Lpj\Http\Controllers;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use Exception;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Maatwebsite\Excel\Facades\Excel; use Maatwebsite\Excel\Facades\Excel;
use Modules\Lpj\Exports\JenisLegalitasJaminanExport; use Modules\Lpj\Exports\JenisLegalitasJaminanExport;
@ -29,7 +30,7 @@
return redirect() return redirect()
->route('basicdata.jenis-legalitas-jaminan.index') ->route('basicdata.jenis-legalitas-jaminan.index')
->with('success', 'Jenis Legalitas Jaminan created successfully'); ->with('success', 'Jenis Legalitas Jaminan created successfully');
} catch (\Exception $e) { } catch (Exception $e) {
return redirect() return redirect()
->route('basicdata.jenis-legalitas-jaminan.create') ->route('basicdata.jenis-legalitas-jaminan.create')
->with('error', 'Failed to create jenis legalitas jaminan'); ->with('error', 'Failed to create jenis legalitas jaminan');
@ -60,7 +61,7 @@
return redirect() return redirect()
->route('basicdata.jenis-legalitas-jaminan.index') ->route('basicdata.jenis-legalitas-jaminan.index')
->with('success', 'Jenis Legalitas Jaminan updated successfully'); ->with('success', 'Jenis Legalitas Jaminan updated successfully');
} catch (\Exception $e) { } catch (Exception $e) {
return redirect() return redirect()
->route('basicdata.jenis-legalitas-jaminan.edit', $id) ->route('basicdata.jenis-legalitas-jaminan.edit', $id)
->with('error', 'Failed to update jenis legalitas jaminan'); ->with('error', 'Failed to update jenis legalitas jaminan');
@ -76,7 +77,7 @@
$jenisLegalitasJaminan->delete(); $jenisLegalitasJaminan->delete();
echo json_encode(['success' => true, 'message' => 'Jenis Legalitas Jaminan deleted successfully']); 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']); echo json_encode(['success' => false, 'message' => 'Failed to delete jenis legalitas jaminan']);
} }
} }

View File

@ -1,38 +1,40 @@
<?php <?php
namespace Modules\Lpj\Http\Requests; namespace Modules\Lpj\Http\Requests;
use Illuminate\Foundation\Http\FormRequest; use Illuminate\Foundation\Http\FormRequest;
class BranchRequest extends FormRequest class BranchRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{ {
$rules = [ /**
'name' => 'required|string|max:255', * Get the validation rules that apply to the request.
'status' => 'nullable|boolean', */
'authorized_at' => 'nullable|datetime', public function rules()
'authorized_status' => 'nullable|string|max:1', : array
'authorized_by' => 'nullable|exists:users,id', {
]; $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') { if ($this->method() == 'PUT') {
$rules['code'] = 'required|string|max:3|unique:branches,code,' . $this->id; $rules['code'] = 'required|string|max:3|unique:branches,code,' . $this->id;
} else { } else {
$rules['code'] = 'required|string|max:3|unique:branches,code'; $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;
}
}

View File

@ -1,33 +1,35 @@
<?php <?php
namespace Modules\Lpj\Http\Requests; namespace Modules\Lpj\Http\Requests;
use Illuminate\Foundation\Http\FormRequest; use Illuminate\Foundation\Http\FormRequest;
class JenisAsetRequest extends FormRequest class JenisAsetRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{ {
$rules = [ /**
'name' => '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') { if ($this->method() == 'PUT') {
$rules['code'] = 'required|max:50|unique:jenis_aset,code,' . $this->id; $rules['code'] = 'required|max:50|unique:jenis_aset,code,' . $this->id;
} else { } else {
$rules['code'] = 'required|max:50|unique:jenis_aset,code'; $rules['code'] = 'required|max:50|unique:jenis_aset,code';
}
return $rules;
} }
return $rules;
}
/** /**
* Determine if the user is authorized to make this request. * Determine if the user is authorized to make this request.
*/ */
public function authorize(): bool public function authorize()
{ : bool
return true; {
return true;
}
} }
}

View File

@ -1,33 +1,35 @@
<?php <?php
namespace Modules\Lpj\Http\Requests; namespace Modules\Lpj\Http\Requests;
use Illuminate\Foundation\Http\FormRequest; use Illuminate\Foundation\Http\FormRequest;
class JenisJaminanRequest extends FormRequest class JenisJaminanRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{ {
$rules = [ /**
'name' => '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') { if ($this->method() == 'PUT') {
$rules['code'] = 'required|max:50|unique:jenis_jaminan,code,' . $this->id; $rules['code'] = 'required|max:50|unique:jenis_jaminan,code,' . $this->id;
} else { } else {
$rules['code'] = 'required|max:50|unique:jenis_jaminan,code'; $rules['code'] = 'required|max:50|unique:jenis_jaminan,code';
}
return $rules;
} }
return $rules;
}
/** /**
* Determine if the user is authorized to make this request. * Determine if the user is authorized to make this request.
*/ */
public function authorize(): bool public function authorize()
{ : bool
return true; {
return true;
}
} }
}

View File

@ -1,33 +1,35 @@
<?php <?php
namespace Modules\Lpj\Http\Requests; namespace Modules\Lpj\Http\Requests;
use Illuminate\Foundation\Http\FormRequest; use Illuminate\Foundation\Http\FormRequest;
class JenisLegalitasJaminanRequest extends FormRequest class JenisLegalitasJaminanRequest extends FormRequest
{
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{ {
$rules = [ /**
'name' => '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') { if ($this->method() == 'PUT') {
$rules['code'] = 'required|max:50|unique:jenis_legalitas_jaminan,code,' . $this->id; $rules['code'] = 'required|max:50|unique:jenis_legalitas_jaminan,code,' . $this->id;
} else { } else {
$rules['code'] = 'required|max:50|unique:jenis_legalitas_jaminan,code'; $rules['code'] = 'required|max:50|unique:jenis_legalitas_jaminan,code';
}
return $rules;
} }
return $rules;
}
/** /**
* Determine if the user is authorized to make this request. * Determine if the user is authorized to make this request.
*/ */
public function authorize(): bool public function authorize()
{ : bool
return true; {
return true;
}
} }
}

View File

@ -1,14 +1,15 @@
<?php <?php
namespace Modules\Lpj\Models; namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Eloquent\SoftDeletes;
use Spatie\Activitylog\LogOptions; use Spatie\Activitylog\LogOptions;
use Spatie\Activitylog\Traits\LogsActivity; use Spatie\Activitylog\Traits\LogsActivity;
use Wildside\Userstamps\Userstamps; use Wildside\Userstamps\Userstamps;
/** /**
* *
*/ */
class Base extends Model class Base extends Model
@ -30,8 +31,8 @@
// Retrieve the module configuration from the module.json file // Retrieve the module configuration from the module.json file
$modulePath = dirname(__FILE__, 3) . '/module.json'; $modulePath = dirname(__FILE__, 3) . '/module.json';
$module = file_get_contents($modulePath); $module = file_get_contents($modulePath);
$module = json_decode($module); $module = json_decode($module);
// Set the connection property to the database connection specified in the module configuration // Set the connection property to the database connection specified in the module configuration
$this->connection = $module->database; $this->connection = $module->database;

View File

@ -1,13 +1,16 @@
<?php <?php
namespace Modules\Lpj\Models; namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model; use Modules\Lpj\Database\Factories\BranchFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\BranchFactory;
class Branch extends Base class Branch extends Base
{ {
protected $table = 'branches'; protected $table = 'branches';
protected $fillable = ['code','name', 'status', 'authorized_at', 'authorized_status', 'authorized_by']; protected $fillable = ['code', 'name', 'status', 'authorized_at', 'authorized_status', 'authorized_by'];
}
public function debitures()
{
return $this->hasMany(Debiture::class, 'branch_id', 'id');
}
}

View File

@ -1,14 +1,20 @@
<?php <?php
namespace Modules\Lpj\Models; namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model; use Modules\Lpj\Database\Factories\CurrencyFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\CurrencyFactory;
class Currency extends Base class Currency extends Base
{ {
protected $table = 'currencies'; protected $table = 'currencies';
protected $fillable = ['code', 'name', 'decimal_places','status', 'authorized_at', 'authorized_status', 'authorized_by']; protected $fillable = [
} 'code',
'name',
'decimal_places',
'status',
'authorized_at',
'authorized_status',
'authorized_by'
];
}

View File

@ -1,13 +1,11 @@
<?php <?php
namespace Modules\Lpj\Models; namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model; use Modules\Lpj\Database\Factories\JenisAsetFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\JenisAsetFactory;
class JenisAset extends Base class JenisAset extends Base
{ {
protected $table = 'jenis_aset'; protected $table = 'jenis_aset';
protected $fillable = ['code', 'name']; protected $fillable = ['code', 'name'];
} }

View File

@ -1,11 +1,11 @@
<?php <?php
namespace Modules\Lpj\Models; namespace Modules\Lpj\Models;
class JenisFasilitasKredit extends Base class JenisFasilitasKredit extends Base
{ {
protected $table = 'jenis_fasilitas_kredit'; protected $table = 'jenis_fasilitas_kredit';
protected $fillable = ['code', 'name']; protected $fillable = ['code', 'name'];
} }

View File

@ -1,13 +1,11 @@
<?php <?php
namespace Modules\Lpj\Models; namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model; use Modules\Lpj\Database\Factories\JenisJaminanFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\JenisJaminanFactory;
class JenisJaminan extends Base class JenisJaminan extends Base
{ {
protected $table = 'jenis_jaminan'; protected $table = 'jenis_jaminan';
protected $fillable = ['code', 'name']; protected $fillable = ['code', 'name'];
} }

View File

@ -1,13 +1,11 @@
<?php <?php
namespace Modules\Lpj\Models; namespace Modules\Lpj\Models;
use Illuminate\Database\Eloquent\Model; use Modules\Lpj\Database\Factories\JenisLegalitasJaminanFactory;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\JenisLegalitasJaminanFactory;
class JenisLegalitasJaminan extends Base class JenisLegalitasJaminan extends Base
{ {
protected $table = 'jenis_legalitas_jaminan'; protected $table = 'jenis_legalitas_jaminan';
protected $fillable = ['code', 'name']; protected $fillable = ['code', 'name'];
} }

View File

@ -1,32 +1,32 @@
<?php <?php
namespace Modules\Lpj\Providers; namespace Modules\Lpj\Providers;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
class EventServiceProvider extends ServiceProvider class EventServiceProvider extends ServiceProvider
{
/**
* The event handler mappings for the application.
*
* @var array<string, array<int, string>>
*/
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
{ {
/**
* Indicates if events should be discovered.
*
* @var bool
*/
protected static $shouldDiscoverEvents = true;
/**
* The event handler mappings for the application.
*
* @var array<string, array<int, string>>
*/
protected $listen = [];
/**
* Configure the proper event listeners for email verification.
*
* @return void
*/
protected function configureEmailVerification()
: void
{
}
} }
}

View File

@ -1,124 +1,133 @@
<?php <?php
namespace Modules\Lpj\Providers; namespace Modules\Lpj\Providers;
use Illuminate\Support\Facades\Blade; use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
class LpjServiceProvider extends ServiceProvider class LpjServiceProvider extends ServiceProvider
{
protected string $moduleName = 'Lpj';
protected string $moduleNameLower = 'lpj';
/**
* Boot the application events.
*/
public function boot(): void
{ {
$this->registerCommands(); protected string $moduleName = 'Lpj';
$this->registerCommandSchedules();
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
$this->loadMigrationsFrom(module_path($this->moduleName, 'database/migrations'));
if (class_exists('Breadcrumbs')) { protected string $moduleNameLower = 'lpj';
require __DIR__ . '/../../routes/breadcrumbs.php';
}
}
/** /**
* Register the service provider. * Boot the application events.
*/ */
public function register(): void public function boot()
{ : void
$this->app->register(EventServiceProvider::class); {
$this->app->register(RouteServiceProvider::class); $this->registerCommands();
} $this->registerCommandSchedules();
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
$this->loadMigrationsFrom(module_path($this->moduleName, 'database/migrations'));
/** if (class_exists('Breadcrumbs')) {
* Register commands in the format of Command::class require __DIR__ . '/../../routes/breadcrumbs.php';
*/
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<string>
*/
public function provides(): array
{
return [];
}
/**
* @return array<string>
*/
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 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<string>
*/
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<string>
*/
public function provides()
: array
{
return [];
}
} }
}

View File

@ -1,49 +1,53 @@
<?php <?php
namespace Modules\Lpj\Providers; namespace Modules\Lpj\Providers;
use Illuminate\Support\Facades\Route; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; use Illuminate\Support\Facades\Route;
class RouteServiceProvider extends ServiceProvider class RouteServiceProvider extends ServiceProvider
{
/**
* Called before routes are registered.
*
* Register any model bindings or pattern based filters.
*/
public function boot(): void
{ {
parent::boot(); /**
} * Called before routes are registered.
*
* Register any model bindings or pattern based filters.
*/
public function boot()
: void
{
parent::boot();
}
/** /**
* Define the routes for the application. * Define the routes for the application.
*/ */
public function map(): void public function map()
{ : void
$this->mapApiRoutes(); {
$this->mapApiRoutes();
$this->mapWebRoutes(); $this->mapWebRoutes();
} }
/** /**
* Define the "web" routes for the application. * Define the "api" routes for the application.
* *
* These routes all receive session state, CSRF protection, etc. * These routes are typically stateless.
*/ */
protected function mapWebRoutes(): void protected function mapApiRoutes()
{ : void
Route::middleware('web')->group(module_path('Lpj', '/routes/web.php')); {
} Route::middleware('api')->prefix('api')->name('api.')->group(module_path('Lpj', '/routes/api.php'));
}
/** /**
* Define the "api" routes for the application. * Define the "web" routes for the application.
* *
* These routes are typically stateless. * These routes all receive session state, CSRF protection, etc.
*/ */
protected function mapApiRoutes(): void protected function mapWebRoutes()
{ : void
Route::middleware('api')->prefix('api')->name('api.')->group(module_path('Lpj', '/routes/api.php')); {
Route::middleware('web')->group(module_path('Lpj', '/routes/web.php'));
}
} }
}

View File

@ -1,5 +1,5 @@
<?php <?php
return [ return [
'name' => 'Lpj', 'name' => 'Lpj',
]; ];

View File

@ -1,33 +1,39 @@
<?php <?php
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class extends Migration return new class extends Migration {
{ /**
/** * Run the migrations.
* Run the migrations. */
*/ public function up()
public function up(): void : void
{ {
Schema::create('jenis_fasilitas_kredit', function (Blueprint $table) { Schema::create('jenis_fasilitas_kredit', function (Blueprint $table) {
$table->id(); $table->id();
$table->string('code'); $table->string('code')->unique()->index();
$table->string('name'); $table->string('name');
$table->timestamps(); $table->boolean('status')->default(true)->nullable();
$table->softDeletes(); $table->timestamps();
$table->uuid('created_by')->nullable(); $table->timestamp('authorized_at')->nullable();
$table->uuid('updated_by')->nullable(); $table->char('authorized_status', 1)->nullable();
$table->uuid('deleted_by')->nullable(); $table->softDeletes();
});
}
/** $table->unsignedBigInteger('created_by')->nullable();
* Reverse the migrations. $table->unsignedBigInteger('updated_by')->nullable();
*/ $table->unsignedBigInteger('deleted_by')->nullable();
public function down(): void $table->unsignedBigInteger('authorized_by')->nullable();
{ });
Schema::dropIfExists('jenis_fasilitas_kredit'); }
}
}; /**
* Reverse the migrations.
*/
public function down()
: void
{
Schema::dropIfExists('jenis_fasilitas_kredit');
}
};

View File

@ -1,33 +1,39 @@
<?php <?php
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class extends Migration return new class extends Migration {
{ /**
/** * Run the migrations.
* Run the migrations. */
*/ public function up()
public function up(): void : void
{ {
Schema::create('jenis_jaminan', function (Blueprint $table) { Schema::create('jenis_jaminan', function (Blueprint $table) {
$table->id(); $table->id();
$table->string('code'); $table->string('code')->unique()->index()();
$table->string('name'); $table->string('name');
$table->timestamps(); $table->boolean('status')->default(true)->nullable();
$table->softDeletes(); $table->timestamps();
$table->uuid('created_by')->nullable(); $table->timestamp('authorized_at')->nullable();
$table->uuid('updated_by')->nullable(); $table->char('authorized_status', 1)->nullable();
$table->uuid('deleted_by')->nullable(); $table->softDeletes();
});
}
/** $table->unsignedBigInteger('created_by')->nullable();
* Reverse the migrations. $table->unsignedBigInteger('updated_by')->nullable();
*/ $table->unsignedBigInteger('deleted_by')->nullable();
public function down(): void $table->unsignedBigInteger('authorized_by')->nullable();
{ });
Schema::dropIfExists('jenis_jaminan'); }
}
}; /**
* Reverse the migrations.
*/
public function down()
: void
{
Schema::dropIfExists('jenis_jaminan');
}
};

View File

@ -1,33 +1,39 @@
<?php <?php
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class extends Migration return new class extends Migration {
{ /**
/** * Run the migrations.
* Run the migrations. */
*/ public function up()
public function up(): void : void
{ {
Schema::create('jenis_legalitas_jaminan', function (Blueprint $table) { Schema::create('jenis_legalitas_jaminan', function (Blueprint $table) {
$table->id(); $table->id();
$table->string('code'); $table->string('code')->unique()->index();
$table->string('name'); $table->string('name');
$table->timestamps(); $table->boolean('status')->default(true)->nullable();
$table->softDeletes(); $table->timestamps();
$table->uuid('created_by')->nullable(); $table->timestamp('authorized_at')->nullable();
$table->uuid('updated_by')->nullable(); $table->char('authorized_status', 1)->nullable();
$table->uuid('deleted_by')->nullable(); $table->softDeletes();
});
}
/** $table->unsignedBigInteger('created_by')->nullable();
* Reverse the migrations. $table->unsignedBigInteger('updated_by')->nullable();
*/ $table->unsignedBigInteger('deleted_by')->nullable();
public function down(): void $table->unsignedBigInteger('authorized_by')->nullable();
{ });
Schema::dropIfExists('jenis_legalitas_jaminan'); }
}
}; /**
* Reverse the migrations.
*/
public function down()
: void
{
Schema::dropIfExists('jenis_legalitas_jaminan');
}
};

View File

@ -1,33 +1,39 @@
<?php <?php
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class extends Migration return new class extends Migration {
{ /**
/** * Run the migrations.
* Run the migrations. */
*/ public function up()
public function up(): void : void
{ {
Schema::create('jenis_aset', function (Blueprint $table) { Schema::create('jenis_aset', function (Blueprint $table) {
$table->id(); $table->id();
$table->string('code'); $table->string('code')->unique()->index();
$table->string('name'); $table->string('name');
$table->timestamps(); $table->boolean('status')->default(true)->nullable();
$table->softDeletes(); $table->timestamps();
$table->uuid('created_by')->nullable(); $table->timestamp('authorized_at')->nullable();
$table->uuid('updated_by')->nullable(); $table->char('authorized_status', 1)->nullable();
$table->uuid('deleted_by')->nullable(); $table->softDeletes();
});
}
/** $table->unsignedBigInteger('created_by')->nullable();
* Reverse the migrations. $table->unsignedBigInteger('updated_by')->nullable();
*/ $table->unsignedBigInteger('deleted_by')->nullable();
public function down(): void $table->unsignedBigInteger('authorized_by')->nullable();
{ });
Schema::dropIfExists('jenis_aset'); }
}
}; /**
* Reverse the migrations.
*/
public function down()
: void
{
Schema::dropIfExists('jenis_aset');
}
};

View File

@ -1,38 +1,39 @@
<?php <?php
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class extends Migration return new class extends Migration {
{ /**
/** * Run the migrations.
* Run the migrations. */
*/ public function up()
public function up(): void : void
{ {
Schema::create('branches', function (Blueprint $table) { Schema::create('branches', function (Blueprint $table) {
$table->id(); $table->id();
$table->string('code', 9)->unique(); $table->string('code', 9)->unique();
$table->string('name'); $table->string('name');
$table->boolean('status')->default(true)->nullable(); $table->boolean('status')->default(true)->nullable();
$table->timestamps(); $table->timestamps();
$table->timestamp('authorized_at')->nullable(); $table->timestamp('authorized_at')->nullable();
$table->char('authorized_status', 1)->nullable(); $table->char('authorized_status', 1)->nullable();
$table->softDeletes(); $table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable(); $table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable(); $table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable(); $table->unsignedBigInteger('deleted_by')->nullable();
$table->unsignedBigInteger('authorized_by')->nullable(); $table->unsignedBigInteger('authorized_by')->nullable();
}); });
} }
/** /**
* Reverse the migrations. * Reverse the migrations.
*/ */
public function down(): void public function down()
{ : void
Schema::dropIfExists('branches'); {
} Schema::dropIfExists('branches');
}; }
};

View File

@ -1,39 +1,40 @@
<?php <?php
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class extends Migration return new class extends Migration {
{ /**
/** * Run the migrations.
* Run the migrations. */
*/ public function up()
public function up(): void : void
{ {
Schema::create('currencies', function (Blueprint $table) { Schema::create('currencies', function (Blueprint $table) {
$table->id(); $table->id();
$table->string('code',3)->unique(); $table->string('code', 3)->unique();
$table->string('name'); $table->string('name');
$table->integer('decimal_places')->default(2); $table->integer('decimal_places')->default(2);
$table->boolean('status')->default(true)->nullable(); $table->boolean('status')->default(true)->nullable();
$table->timestamps(); $table->timestamps();
$table->timestamp('authorized_at')->nullable(); $table->timestamp('authorized_at')->nullable();
$table->char('authorized_status', 1)->nullable(); $table->char('authorized_status', 1)->nullable();
$table->softDeletes(); $table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable(); $table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable(); $table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable(); $table->unsignedBigInteger('deleted_by')->nullable();
$table->unsignedBigInteger('authorized_by')->nullable(); $table->unsignedBigInteger('authorized_by')->nullable();
}); });
} }
/** /**
* Reverse the migrations. * Reverse the migrations.
*/ */
public function down(): void public function down()
{ : void
Schema::dropIfExists('currencies'); {
} Schema::dropIfExists('currencies');
}; }
};

View File

@ -1,16 +1,17 @@
<?php <?php
namespace Modules\Lpj\Database\Seeders; namespace Modules\Lpj\Database\Seeders;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
class LpjDatabaseSeeder extends Seeder class LpjDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{ {
// $this->call([]); /**
* Run the database seeds.
*/
public function run()
: void
{
// $this->call([]);
}
} }
}

View File

@ -1,15 +1,15 @@
{ {
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vite build" "build": "vite build"
}, },
"devDependencies": { "devDependencies": {
"axios": "^1.1.2", "axios": "^1.1.2",
"laravel-vite-plugin": "^0.7.5", "laravel-vite-plugin": "^0.7.5",
"sass": "^1.69.5", "sass": "^1.69.5",
"postcss": "^8.3.7", "postcss": "^8.3.7",
"vite": "^4.0.0" "vite": "^4.0.0"
} }
} }

View File

@ -9,50 +9,50 @@
@if(isset($branch->id)) @if(isset($branch->id))
<form action="{{ route('basicdata.branch.update', $branch->id) }}" method="POST"> <form action="{{ route('basicdata.branch.update', $branch->id) }}" method="POST">
<input type="hidden" name="id" value="{{ $branch->id }}"> <input type="hidden" name="id" value="{{ $branch->id }}">
@method('PUT') @method('PUT')
@else @else
<form method="POST" action="{{ route('basicdata.branch.store') }}"> <form method="POST" action="{{ route('basicdata.branch.store') }}">
@endif @endif
@csrf @csrf
<div class="card pb-2.5"> <div class="card pb-2.5">
<div class="card-header" id="basic_settings"> <div class="card-header" id="basic_settings">
<h3 class="card-title"> <h3 class="card-title">
{{ isset($branch->id) ? 'Edit' : 'Tambah' }} Branch {{ isset($branch->id) ? 'Edit' : 'Tambah' }} Branch
</h3> </h3>
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<a href="{{ route('basicdata.branch.index') }}" class="btn btn-xs btn-info">Back</a> <a href="{{ route('basicdata.branch.index') }}" class="btn btn-xs btn-info">Back</a>
</div> </div>
</div> </div>
<div class="card-body grid gap-5"> <div class="card-body grid gap-5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56"> <label class="form-label max-w-56">
Code Code
</label> </label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<input class="input @error('code') border-danger @enderror" type="text" name="code" value="{{ $branch->code ?? '' }}"> <input class="input @error('code') border-danger @enderror" type="text" name="code" value="{{ $branch->code ?? '' }}">
@error('code') @error('code')
<em class="alert text-danger text-sm">{{ $message }}</em> <em class="alert text-danger text-sm">{{ $message }}</em>
@enderror @enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Name
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('name') border-danger @enderror" type="text" name="name" value="{{ $branch->name ?? '' }}">
@error('name')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex justify-end">
<button type="submit" class="btn btn-primary">
Save
</button>
</div>
</div>
</div> </div>
</div> </form>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Name
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('name') border-danger @enderror" type="text" name="name" value="{{ $branch->name ?? '' }}">
@error('name')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex justify-end">
<button type="submit" class="btn btn-primary">
Save
</button>
</div>
</div>
</div>
</form>
</div> </div>
@endsection @endsection

View File

@ -9,61 +9,61 @@
@if(isset($currency->id)) @if(isset($currency->id))
<form action="{{ route('basicdata.currency.update', $currency->id) }}" method="POST"> <form action="{{ route('basicdata.currency.update', $currency->id) }}" method="POST">
<input type="hidden" name="id" value="{{ $currency->id }}"> <input type="hidden" name="id" value="{{ $currency->id }}">
@method('PUT') @method('PUT')
@else @else
<form method="POST" action="{{ route('basicdata.currency.store') }}"> <form method="POST" action="{{ route('basicdata.currency.store') }}">
@endif @endif
@csrf @csrf
<div class="card pb-2.5"> <div class="card pb-2.5">
<div class="card-header" id="basic_settings"> <div class="card-header" id="basic_settings">
<h3 class="card-title"> <h3 class="card-title">
{{ isset($currency->id) ? 'Edit' : 'Tambah' }} Currency {{ isset($currency->id) ? 'Edit' : 'Tambah' }} Currency
</h3> </h3>
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<a href="{{ route('basicdata.currency.index') }}" class="btn btn-xs btn-info">Back</a> <a href="{{ route('basicdata.currency.index') }}" class="btn btn-xs btn-info">Back</a>
</div> </div>
</div> </div>
<div class="card-body grid gap-5"> <div class="card-body grid gap-5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56"> <label class="form-label max-w-56">
Code Code
</label> </label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<input class="input @error('code') border-danger @enderror" type="text" name="code" value="{{ $currency->code ?? '' }}"> <input class="input @error('code') border-danger @enderror" type="text" name="code" value="{{ $currency->code ?? '' }}">
@error('code') @error('code')
<em class="alert text-danger text-sm">{{ $message }}</em> <em class="alert text-danger text-sm">{{ $message }}</em>
@enderror @enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Name
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('name') border-danger @enderror" type="text" name="name" value="{{ $currency->name ?? '' }}">
@error('name')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Decimal Places
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('decimal_places') border-danger @enderror" type="number" min="0" max="3" name="decimal_places" value="{{ $currency->decimal_places ?? '' }}">
@error('decimal_places')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex justify-end">
<button type="submit" class="btn btn-primary">
Save
</button>
</div>
</div>
</div> </div>
</div> </form>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Name
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('name') border-danger @enderror" type="text" name="name" value="{{ $currency->name ?? '' }}">
@error('name')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Decimal Places
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('decimal_places') border-danger @enderror" type="number" min="0" max="3" name="decimal_places" value="{{ $currency->decimal_places ?? '' }}">
@error('decimal_places')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex justify-end">
<button type="submit" class="btn btn-primary">
Save
</button>
</div>
</div>
</div>
</form>
</div> </div>
@endsection @endsection

View File

@ -9,50 +9,50 @@
@if(isset($jenisAset->id)) @if(isset($jenisAset->id))
<form action="{{ route('basicdata.jenis-aset.update', $jenisAset->id) }}" method="POST"> <form action="{{ route('basicdata.jenis-aset.update', $jenisAset->id) }}" method="POST">
<input type="hidden" name="id" value="{{ $jenisAset->id }}"> <input type="hidden" name="id" value="{{ $jenisAset->id }}">
@method('PUT') @method('PUT')
@else @else
<form method="POST" action="{{ route('basicdata.jenis-aset.store') }}"> <form method="POST" action="{{ route('basicdata.jenis-aset.store') }}">
@endif @endif
@csrf @csrf
<div class="card pb-2.5"> <div class="card pb-2.5">
<div class="card-header" id="basic_settings"> <div class="card-header" id="basic_settings">
<h3 class="card-title"> <h3 class="card-title">
{{ isset($jenisAset->id) ? 'Edit' : 'Tambah' }} Jenis Aset {{ isset($jenisAset->id) ? 'Edit' : 'Tambah' }} Jenis Aset
</h3> </h3>
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<a href="{{ route('basicdata.jenis-aset.index') }}" class="btn btn-xs btn-info">Back</a> <a href="{{ route('basicdata.jenis-aset.index') }}" class="btn btn-xs btn-info">Back</a>
</div> </div>
</div> </div>
<div class="card-body grid gap-5"> <div class="card-body grid gap-5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56"> <label class="form-label max-w-56">
Code Code
</label> </label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<input class="input @error('code') border-danger @enderror" type="text" name="code" value="{{ $jenisAset->code ?? '' }}"> <input class="input @error('code') border-danger @enderror" type="text" name="code" value="{{ $jenisAset->code ?? '' }}">
@error('code') @error('code')
<em class="alert text-danger text-sm">{{ $message }}</em> <em class="alert text-danger text-sm">{{ $message }}</em>
@enderror @enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Name
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('name') border-danger @enderror" type="text" name="name" value="{{ $jenisAset->name ?? '' }}">
@error('name')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex justify-end">
<button type="submit" class="btn btn-primary">
Save
</button>
</div>
</div>
</div> </div>
</div> </form>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Name
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('name') border-danger @enderror" type="text" name="name" value="{{ $jenisAset->name ?? '' }}">
@error('name')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex justify-end">
<button type="submit" class="btn btn-primary">
Save
</button>
</div>
</div>
</div>
</form>
</div> </div>
@endsection @endsection

View File

@ -9,50 +9,50 @@
@if(isset($jenisFasilitasKredit->id)) @if(isset($jenisFasilitasKredit->id))
<form action="{{ route('basicdata.jenis-fasilitas-kredit.update', $jenisFasilitasKredit->id) }}" method="POST"> <form action="{{ route('basicdata.jenis-fasilitas-kredit.update', $jenisFasilitasKredit->id) }}" method="POST">
<input type="hidden" name="id" value="{{ $jenisFasilitasKredit->id }}"> <input type="hidden" name="id" value="{{ $jenisFasilitasKredit->id }}">
@method('PUT') @method('PUT')
@else @else
<form method="POST" action="{{ route('basicdata.jenis-fasilitas-kredit.store') }}"> <form method="POST" action="{{ route('basicdata.jenis-fasilitas-kredit.store') }}">
@endif @endif
@csrf @csrf
<div class="card pb-2.5"> <div class="card pb-2.5">
<div class="card-header" id="basic_settings"> <div class="card-header" id="basic_settings">
<h3 class="card-title"> <h3 class="card-title">
{{ isset($jenisFasilitasKredit->id) ? 'Edit' : 'Tambah' }} Jenis Fasilitas Kredit {{ isset($jenisFasilitasKredit->id) ? 'Edit' : 'Tambah' }} Jenis Fasilitas Kredit
</h3> </h3>
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<a href="{{ route('basicdata.jenis-fasilitas-kredit.index') }}" class="btn btn-xs btn-info">Back</a> <a href="{{ route('basicdata.jenis-fasilitas-kredit.index') }}" class="btn btn-xs btn-info">Back</a>
</div> </div>
</div> </div>
<div class="card-body grid gap-5"> <div class="card-body grid gap-5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56"> <label class="form-label max-w-56">
Code Code
</label> </label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<input class="input @error('code') border-danger @enderror" type="text" name="code" value="{{ $jenisFasilitasKredit->code ?? '' }}"> <input class="input @error('code') border-danger @enderror" type="text" name="code" value="{{ $jenisFasilitasKredit->code ?? '' }}">
@error('code') @error('code')
<em class="alert text-danger text-sm">{{ $message }}</em> <em class="alert text-danger text-sm">{{ $message }}</em>
@enderror @enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Name
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('name') border-danger @enderror" type="text" name="name" value="{{ $jenisFasilitasKredit->name ?? '' }}">
@error('name')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex justify-end">
<button type="submit" class="btn btn-primary">
Save
</button>
</div>
</div>
</div> </div>
</div> </form>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Name
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('name') border-danger @enderror" type="text" name="name" value="{{ $jenisFasilitasKredit->name ?? '' }}">
@error('name')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex justify-end">
<button type="submit" class="btn btn-primary">
Save
</button>
</div>
</div>
</div>
</form>
</div> </div>
@endsection @endsection

View File

@ -9,50 +9,50 @@
@if(isset($jenisJaminan->id)) @if(isset($jenisJaminan->id))
<form action="{{ route('basicdata.jenis-jaminan.update', $jenisJaminan->id) }}" method="POST"> <form action="{{ route('basicdata.jenis-jaminan.update', $jenisJaminan->id) }}" method="POST">
<input type="hidden" name="id" value="{{ $jenisJaminan->id }}"> <input type="hidden" name="id" value="{{ $jenisJaminan->id }}">
@method('PUT') @method('PUT')
@else @else
<form method="POST" action="{{ route('basicdata.jenis-jaminan.store') }}"> <form method="POST" action="{{ route('basicdata.jenis-jaminan.store') }}">
@endif @endif
@csrf @csrf
<div class="card pb-2.5"> <div class="card pb-2.5">
<div class="card-header" id="basic_settings"> <div class="card-header" id="basic_settings">
<h3 class="card-title"> <h3 class="card-title">
{{ isset($jenisJaminan->id) ? 'Edit' : 'Tambah' }} Jenis Jaminan {{ isset($jenisJaminan->id) ? 'Edit' : 'Tambah' }} Jenis Jaminan
</h3> </h3>
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<a href="{{ route('basicdata.jenis-jaminan.index') }}" class="btn btn-xs btn-info">Back</a> <a href="{{ route('basicdata.jenis-jaminan.index') }}" class="btn btn-xs btn-info">Back</a>
</div> </div>
</div> </div>
<div class="card-body grid gap-5"> <div class="card-body grid gap-5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56"> <label class="form-label max-w-56">
Code Code
</label> </label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<input class="input @error('code') border-danger @enderror" type="text" name="code" value="{{ $jenisJaminan->code ?? '' }}"> <input class="input @error('code') border-danger @enderror" type="text" name="code" value="{{ $jenisJaminan->code ?? '' }}">
@error('code') @error('code')
<em class="alert text-danger text-sm">{{ $message }}</em> <em class="alert text-danger text-sm">{{ $message }}</em>
@enderror @enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Name
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('name') border-danger @enderror" type="text" name="name" value="{{ $jenisJaminan->name ?? '' }}">
@error('name')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex justify-end">
<button type="submit" class="btn btn-primary">
Save
</button>
</div>
</div>
</div> </div>
</div> </form>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Name
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('name') border-danger @enderror" type="text" name="name" value="{{ $jenisJaminan->name ?? '' }}">
@error('name')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex justify-end">
<button type="submit" class="btn btn-primary">
Save
</button>
</div>
</div>
</div>
</form>
</div> </div>
@endsection @endsection

View File

@ -9,50 +9,50 @@
@if(isset($jenisLegalitasJaminan->id)) @if(isset($jenisLegalitasJaminan->id))
<form action="{{ route('basicdata.jenis-legalitas-jaminan.update', $jenisLegalitasJaminan->id) }}" method="POST"> <form action="{{ route('basicdata.jenis-legalitas-jaminan.update', $jenisLegalitasJaminan->id) }}" method="POST">
<input type="hidden" name="id" value="{{ $jenisLegalitasJaminan->id }}"> <input type="hidden" name="id" value="{{ $jenisLegalitasJaminan->id }}">
@method('PUT') @method('PUT')
@else @else
<form method="POST" action="{{ route('basicdata.jenis-legalitas-jaminan.store') }}"> <form method="POST" action="{{ route('basicdata.jenis-legalitas-jaminan.store') }}">
@endif @endif
@csrf @csrf
<div class="card pb-2.5"> <div class="card pb-2.5">
<div class="card-header" id="basic_settings"> <div class="card-header" id="basic_settings">
<h3 class="card-title"> <h3 class="card-title">
{{ isset($jenisLegalitasJaminan->id) ? 'Edit' : 'Tambah' }} Jenis Legalitas Jaminan {{ isset($jenisLegalitasJaminan->id) ? 'Edit' : 'Tambah' }} Jenis Legalitas Jaminan
</h3> </h3>
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<a href="{{ route('basicdata.jenis-legalitas-jaminan.index') }}" class="btn btn-xs btn-info">Back</a> <a href="{{ route('basicdata.jenis-legalitas-jaminan.index') }}" class="btn btn-xs btn-info">Back</a>
</div> </div>
</div> </div>
<div class="card-body grid gap-5"> <div class="card-body grid gap-5">
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5"> <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56"> <label class="form-label max-w-56">
Code Code
</label> </label>
<div class="flex flex-wrap items-baseline w-full"> <div class="flex flex-wrap items-baseline w-full">
<input class="input @error('code') border-danger @enderror" type="text" name="code" value="{{ $jenisLegalitasJaminan->code ?? '' }}"> <input class="input @error('code') border-danger @enderror" type="text" name="code" value="{{ $jenisLegalitasJaminan->code ?? '' }}">
@error('code') @error('code')
<em class="alert text-danger text-sm">{{ $message }}</em> <em class="alert text-danger text-sm">{{ $message }}</em>
@enderror @enderror
</div>
</div>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Name
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('name') border-danger @enderror" type="text" name="name" value="{{ $jenisLegalitasJaminan->name ?? '' }}">
@error('name')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex justify-end">
<button type="submit" class="btn btn-primary">
Save
</button>
</div>
</div>
</div> </div>
</div> </form>
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
<label class="form-label max-w-56">
Name
</label>
<div class="flex flex-wrap items-baseline w-full">
<input class="input @error('name') border-danger @enderror" type="text" name="name" value="{{ $jenisLegalitasJaminan->name ?? '' }}">
@error('name')
<em class="alert text-danger text-sm">{{ $message }}</em>
@enderror
</div>
</div>
<div class="flex justify-end">
<button type="submit" class="btn btn-primary">
Save
</button>
</div>
</div>
</div>
</form>
</div> </div>
@endsection @endsection

View File

@ -1,15 +1,11 @@
<?php <?php
/*
use Illuminate\Support\Facades\Route; *--------------------------------------------------------------------------
use Modules\Lpj\Http\Controllers\LpjController; * API Routes
*--------------------------------------------------------------------------
/* *
*-------------------------------------------------------------------------- * Here is where you can register API routes for your application. These
* API Routes * routes are loaded by the RouteServiceProvider within a group which
*-------------------------------------------------------------------------- * is assigned the "api" middleware group. Enjoy building your API!
* *
* Here is where you can register API routes for your application. These */
* routes are loaded by the RouteServiceProvider within a group which
* is assigned the "api" middleware group. Enjoy building your API!
*
*/

View File

@ -1,4 +1,4 @@
import { defineConfig } from 'vite'; import {defineConfig} from 'vite';
import laravel from 'laravel-vite-plugin'; import laravel from 'laravel-vite-plugin';
export default defineConfig({ export default defineConfig({
@ -23,4 +23,4 @@ export default defineConfig({
//export const paths = [ //export const paths = [
// 'Modules/Lpj/resources/assets/sass/app.scss', // 'Modules/Lpj/resources/assets/sass/app.scss',
// 'Modules/Lpj/resources/assets/js/app.js', // 'Modules/Lpj/resources/assets/js/app.js',
//]; //];