Merge pull request 'penambahan basic data surveyor' (#22) from feature/senior-officer into staging
Reviewed-on: #22
This commit is contained in:
@@ -8,7 +8,21 @@ use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Modules\Lpj\Models\Permohonan;
|
||||
use Modules\Lpj\Models\Branch;
|
||||
use Modules\Lpj\Models\Surveyor;
|
||||
use Modules\Lpj\Models\BentukTanah;
|
||||
use Modules\Lpj\Models\KonturTanah;
|
||||
use Modules\Location\Models\Province;
|
||||
use Modules\Lpj\Models\PosisiKavling;
|
||||
use Modules\Lpj\Models\KondisiFisikTanah;
|
||||
use Modules\Lpj\Models\KetinggianTanah;
|
||||
use Modules\Lpj\Models\SifatBangunan;
|
||||
use Modules\Lpj\Models\JenisBangunan;
|
||||
use Modules\Lpj\Models\KondisiBangunan;
|
||||
use Modules\Lpj\Models\SpekBangunan;
|
||||
use Modules\Lpj\Models\SpekKategoritBangunan;
|
||||
use Modules\Lpj\Models\SaranaPelengkap;
|
||||
use Modules\Lpj\Models\ArahMataAngin;
|
||||
use Modules\Lpj\Http\Requests\SurveyorRequest;
|
||||
|
||||
class SurveyorController extends Controller
|
||||
{
|
||||
@@ -21,21 +35,7 @@ class SurveyorController extends Controller
|
||||
return view('lpj::surveyor.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('lpj::create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
@@ -51,16 +51,46 @@ class SurveyorController extends Controller
|
||||
'debiture.village',
|
||||
'branch',
|
||||
'tujuanPenilaian',
|
||||
'penilaian'
|
||||
'penilaian',
|
||||
'documents',
|
||||
],
|
||||
)->findOrFail($id);
|
||||
|
||||
$surveyor = $id;
|
||||
$branches = Branch::all();
|
||||
$provinces = Province::all();
|
||||
$bentukTanah = BentukTanah::all();
|
||||
$konturTanah = KonturTanah::all();
|
||||
$posisiKavling = PosisiKavling::all();
|
||||
$ketinggianTanah = KetinggianTanah::all();
|
||||
$kondisiFisikTanah = KondisiFisikTanah::all();
|
||||
$jenisBangunan = JenisBangunan::all();
|
||||
$kondisiBangunan = KondisiBangunan::all();
|
||||
$sifatBangunan = SifatBangunan::all();
|
||||
$spekKategoriBagunan = SpekKategoritBangunan::all();
|
||||
$spekBangunan = SpekBangunan::all();
|
||||
$saranaPelengkap = SaranaPelengkap::all();
|
||||
$arahMataAngin = ArahMataAngin::all();
|
||||
|
||||
|
||||
return view('lpj::surveyor.detail', compact('permohonan', 'surveyor', 'branches', 'provinces'));
|
||||
return view('lpj::surveyor.detail', compact(
|
||||
'permohonan',
|
||||
'surveyor',
|
||||
'branches',
|
||||
'provinces',
|
||||
'bentukTanah',
|
||||
'konturTanah',
|
||||
'posisiKavling',
|
||||
'kondisiFisikTanah',
|
||||
'ketinggianTanah',
|
||||
'kondisiBangunan',
|
||||
'jenisBangunan',
|
||||
'sifatBangunan',
|
||||
'spekKategoriBagunan',
|
||||
'spekBangunan',
|
||||
'saranaPelengkap',
|
||||
'arahMataAngin',
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -238,7 +268,273 @@ class SurveyorController extends Controller
|
||||
}
|
||||
|
||||
|
||||
public function data(Request $request)
|
||||
{
|
||||
|
||||
$type = $request->route('type');
|
||||
|
||||
$headers = [
|
||||
'bentuk-tanah' => ['Bentuk Tanah', 'bentuk-tanah'],
|
||||
'kontur-tanah' => ['Kontur Tanah', 'kontur-tanah'],
|
||||
'posisi-kavling' => ['Posisi Kavling', 'posisi-kavling'],
|
||||
'ketinggian-tanah' => ['Ketinggian Tanah', 'ketinggian-tanah'],
|
||||
'kondisi-fisik-tanah' => ['Kondisi Fisik Tanah', 'kondisi-fisik-tanah'],
|
||||
'jenis-bangunan' => ['Jenis Bangunan', 'jenis-bangunan'],
|
||||
'kondisi-bangunan' => ['Kondisi Bangunan', 'kondisi-bangunan'],
|
||||
'sifat-bangunan' => ['Sifat Bangunan', 'sifat-bangunan'],
|
||||
'sarana-pelengkap' => ['Sarana Pelengkap', 'sarana-pelengkap'],
|
||||
];
|
||||
|
||||
$header = $headers[$type] ?? '';
|
||||
|
||||
return view('lpj::surveyor.data.index', compact('header'));
|
||||
}
|
||||
|
||||
|
||||
public function createData($type)
|
||||
{
|
||||
|
||||
$headers = [
|
||||
'bentuk-tanah' => ['Bentuk Tanah', 'bentuk-tanah'],
|
||||
'kontur-tanah' => ['Kontur Tanah', 'kontur-tanah'],
|
||||
'posisi-kavling' => ['Posisi Kavling', 'posisi-kavling'],
|
||||
'ketinggian-tanah' => ['Ketinggian Tanah', 'ketinggian-tanah'],
|
||||
'kondisi-fisik-tanah' => ['Kondisi Fisik Tanah', 'kondisi-fisik-tanah'],
|
||||
'jenis-bangunan' => ['Jenis Bangunan', 'jenis-bangunan'],
|
||||
'kondisi-bangunan' => ['Kondisi Bangunan', 'kondisi-bangunan'],
|
||||
'sifat-bangunan' => ['Sifat Bangunan', 'sifat-bangunan'],
|
||||
'sarana-pelengkap' => ['Sarana Pelengkap', 'sarana-pelengkap'],
|
||||
];
|
||||
|
||||
|
||||
$header = $headers[$type] ?? '';
|
||||
return view('lpj::surveyor.data.form', compact('header'));
|
||||
}
|
||||
|
||||
|
||||
public function storeData(SurveyorRequest $request, $type)
|
||||
{
|
||||
|
||||
$validate = $request->validated();
|
||||
if ($validate) {
|
||||
|
||||
$type = $request->route('type');
|
||||
|
||||
$modelClasses = [
|
||||
'bentuk-tanah' => BentukTanah::class,
|
||||
'kontur-tanah' => KonturTanah::class,
|
||||
'posisi-kavling' => PosisiKavling::class,
|
||||
'bentuk-tanah' => BentukTanah::class,
|
||||
'kontur-tanah' => KonturTanah::class,
|
||||
'posisi-kavling' => PosisiKavling::class,
|
||||
'ketinggian-tanah' => KetinggianTanah::class,
|
||||
'kondisi-fisik-tanah' => KondisiFisikTanah::class,
|
||||
'jenis-bangunan' => JenisBangunan::class,
|
||||
'kondisi-bangunan' => KondisiBangunan::class,
|
||||
'sifat-bangunan' => SifatBangunan::class,
|
||||
'sarana-pelengkap' => SaranaPelengkap::class,
|
||||
];
|
||||
|
||||
if (!array_key_exists($type, $modelClasses)) {
|
||||
return redirect()
|
||||
->route('basicdata.'. $type .'.index')
|
||||
->with('error', 'Invalid type specified.');
|
||||
}
|
||||
|
||||
$modelClass = $modelClasses[$type];
|
||||
$data = $request->all();
|
||||
$data['status'] = true;
|
||||
$modelClass::create($data);
|
||||
|
||||
return redirect()
|
||||
->route('basicdata.' . $type .'.index')
|
||||
->with('success', 'created successfully');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function editData($type, $id)
|
||||
{
|
||||
$dataMap = [
|
||||
'bentuk-tanah' => ['Bentuk Tanah', 'bentuk-tanah', BentukTanah::class],
|
||||
'kontur-tanah' => ['Kontur Tanah', 'kontur-tanah', KonturTanah::class],
|
||||
'posisi-kavling' => ['Posisi Kavling', 'posisi-kavling', PosisiKavling::class],
|
||||
'ketinggian-tanah' => ['Ketinggian Tanah', 'ketinggian-tanah', KetinggianTanah::class],
|
||||
'kondisi-fisik-tanah' => ['Kondisi Fisik Tanah', 'kondisi-fisik-tanah', KondisiFisikTanah::class],
|
||||
'jenis-bangunan' => ['Jenis Bangunan', 'jenis-bangunan', JenisBangunan::class],
|
||||
'kondisi-bangunan' => ['Kondisi Bangunan', 'kondisi-bangunan', KondisiBangunan::class],
|
||||
'sifat-bangunan' => ['Sifat Bangunan', 'sifat-bangunan', SifatBangunan::class],
|
||||
'spek-bangunan' => ['Spek Bangunan', 'spek-bangunan', SpekBangunan::class],
|
||||
'spek-kategori-bangunan' => ['Spek Kategori Bangunan', 'spek-kategori-bangunan', SpekKategoritBangunan::class],
|
||||
'sarana-pelengkap' => ['Sarana Pelengkap', 'sarana-pelengkap', SaranaPelengkap::class],
|
||||
];
|
||||
|
||||
|
||||
if (!array_key_exists($type, $dataMap)) {
|
||||
return redirect()->back()->with('error', 'Invalid type specified.');
|
||||
}
|
||||
|
||||
[$headers, $routeName, $modelClass] = $dataMap[$type];
|
||||
|
||||
$header = $dataMap[$type] ?? '';
|
||||
$model = $modelClass::findOrFail($id);
|
||||
|
||||
return view('lpj::surveyor.data.form', compact('header', 'model'));
|
||||
}
|
||||
|
||||
|
||||
public function updateData(SurveyorRequest $request, $type, $id)
|
||||
{
|
||||
$validate = $request->validated();
|
||||
if ($validate) {
|
||||
$modelClasses = [
|
||||
'bentuk-tanah' => BentukTanah::class,
|
||||
'kontur-tanah' => KonturTanah::class,
|
||||
'posisi-kavling' => PosisiKavling::class,
|
||||
'ketinggian-tanah' => KetinggianTanah::class,
|
||||
'kondisi-fisik-tanah' => KondisiFisikTanah::class,
|
||||
'jenis-bangunan' => JenisBangunan::class,
|
||||
'kondisi-bangunan' => KondisiBangunan::class,
|
||||
'sifat-bangunan' => SifatBangunan::class,
|
||||
'sarana-pelengkap' => SaranaPelengkap::class,
|
||||
|
||||
];
|
||||
|
||||
// Check if the provided type exists in the modelClasses
|
||||
if (!array_key_exists($type, $modelClasses)) {
|
||||
return redirect()
|
||||
->route('basicdata.' . $type . '.index')
|
||||
->with('error', 'Invalid type specified.');
|
||||
}
|
||||
$modelClass = $modelClasses[$type];
|
||||
$model = $modelClass::findOrFail($id);
|
||||
$model->update($validate);
|
||||
|
||||
// Redirect back with a success message
|
||||
return redirect()
|
||||
->route('basicdata.' . $type . '.index')
|
||||
->with('success', 'Updated successfully');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function dataForDatatablesData(Request $request, $type)
|
||||
{
|
||||
if (is_null($this->user) || !$this->user->can('jenis_aset.view')) {
|
||||
//abort(403, 'Sorry! You are not allowed to view users.');
|
||||
}
|
||||
|
||||
// Retrieve data from the database
|
||||
|
||||
$models = [
|
||||
'Bentuk Tanah' => BentukTanah::class,
|
||||
'Kontur Tanah' => KonturTanah::class,
|
||||
'Posisi Kavling' => PosisiKavling::class,
|
||||
'Ketinggian Tanah' => KetinggianTanah::class,
|
||||
'Kondisi Fisik Tanah' => KondisiFisikTanah::class,
|
||||
'Jenis Bangunan' => JenisBangunan::class,
|
||||
'Kondisi Bangunan' => KondisiBangunan::class,
|
||||
'Sifat Bangunan' => SifatBangunan::class,
|
||||
// 'Spek Kategori Bangunan' => SpekKategoritBangunan::class,
|
||||
// 'Spek Bangunan' => SpekBangunan::class,
|
||||
'Sarana Pelengkap' => SaranaPelengkap::class,
|
||||
];
|
||||
|
||||
|
||||
if (array_key_exists($type, $models)) {
|
||||
$query = $models[$type]::query();
|
||||
} else {
|
||||
throw new InvalidArgumentException("Invalid type: $type");
|
||||
}
|
||||
|
||||
|
||||
// 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 destroy($id, $type)
|
||||
{
|
||||
try {
|
||||
|
||||
$modelClasses = [
|
||||
'bentuk-tanah' => BentukTanah::class,
|
||||
'kontur-tanah' => KonturTanah::class,
|
||||
'posisi-kavling' => PosisiKavling::class,
|
||||
'ketinggian-tanah' => KetinggianTanah::class,
|
||||
'kondisi-fisik-tanah' => KondisiFisikTanah::class,
|
||||
'jenis-bangunan' => JenisBangunan::class,
|
||||
'kondisi-bangunan' => KondisiBangunan::class,
|
||||
'sifat-bangunan' => SifatBangunan::class,
|
||||
'sarana-pelengkap' => SaranaPelengkap::class,
|
||||
];
|
||||
|
||||
|
||||
if (!array_key_exists($type, $modelClasses)) {
|
||||
return response()->json(['success' => false, 'message' => 'Invalid type specified.'], 400);
|
||||
}
|
||||
|
||||
$modelClass = $modelClasses[$type];
|
||||
$model = $modelClass::findOrFail($id);
|
||||
|
||||
$model->delete();
|
||||
return response()->json(['success' => true, 'message' => 'deleted successfully']);
|
||||
} catch (ModelNotFoundException $e) {
|
||||
return response()->json(['success' => false, 'message' => 'not found.'], 404);
|
||||
} catch (Exception $e) {
|
||||
return response()->json(['success' => false, 'message' => 'Failed to delete.'], 500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
64
app/Http/Requests/SurveyorRequest.php
Normal file
64
app/Http/Requests/SurveyorRequest.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class SurveyorRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules()
|
||||
: array
|
||||
{
|
||||
|
||||
$action = $this->input('action');
|
||||
|
||||
$uniqueTable = [
|
||||
'bentuk-tanah' => 'bentuk_tanah',
|
||||
'kontur-tanah' => 'kontur_tanah',
|
||||
'posisi-kavling' => 'posisi_kavling',
|
||||
'ketinggian-tanah' => 'ketinggian_tanah',
|
||||
'kondisi-fisik-tanah' => 'kondisi_fisik_tanah',
|
||||
'kondisi-bangunan' => 'kondisi_bangunan',
|
||||
'sifat-bangunan' => 'sifat_bangunan',
|
||||
'sarana-pelengkap' => 'sarana_pelengkap',
|
||||
'lalu_lintas_lokasi' => 'lalu_lintas_lokasi',
|
||||
'tingkat-keramaian' => 'tingkat_keramaian',
|
||||
];
|
||||
|
||||
|
||||
|
||||
$rules = [
|
||||
'name' => 'required|max:255',
|
||||
|
||||
];
|
||||
|
||||
$id = $this->route('id');
|
||||
|
||||
if ($this->method() == 'PUT' || $this->method() == 'PATCH') {
|
||||
$rules['code'] = 'required|max:50|unique:' . $uniqueTable[$action] . ',code,' . $id;
|
||||
} else {
|
||||
|
||||
$rules['code'] = 'required|max:50|unique:' . $uniqueTable[$action] . ',code';
|
||||
}
|
||||
return $rules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize()
|
||||
: bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function prepareForValidation()
|
||||
{
|
||||
$this->merge([
|
||||
'status' => true,
|
||||
]);
|
||||
}
|
||||
}
|
||||
24
app/Models/BentukTanah.php
Normal file
24
app/Models/BentukTanah.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\BentukTanahFactory;
|
||||
|
||||
class BentukTanah extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'bentuk_tanah';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
|
||||
protected static function newFactory(): BentukTanahFactory
|
||||
{
|
||||
//return BentukTanahFactory::new();
|
||||
}
|
||||
}
|
||||
22
app/Models/GolonganMasySekitar.php
Normal file
22
app/Models/GolonganMasySekitar.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\GolonganMasySekitarFactory;
|
||||
|
||||
class GolonganMasySekitar extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [];
|
||||
|
||||
protected static function newFactory(): GolonganMasySekitarFactory
|
||||
{
|
||||
//return GolonganMasySekitarFactory::new();
|
||||
}
|
||||
}
|
||||
23
app/Models/JenisBangunan.php
Normal file
23
app/Models/JenisBangunan.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\JenisBangunanFactory;
|
||||
|
||||
class JenisBangunan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'jenis_bangunan';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
protected static function newFactory(): JenisBangunanFactory
|
||||
{
|
||||
//return JenisBangunanFactory::new();
|
||||
}
|
||||
}
|
||||
24
app/Models/KetinggianTanah.php
Normal file
24
app/Models/KetinggianTanah.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\KetinggianTanahFactory;
|
||||
|
||||
class KetinggianTanah extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'ketinggian_tanah';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): KetinggianTanahFactory
|
||||
{
|
||||
//return KetinggianTanahFactory::new();
|
||||
}
|
||||
}
|
||||
23
app/Models/KondisiBangunan.php
Normal file
23
app/Models/KondisiBangunan.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\KondisiBangunanFactory;
|
||||
|
||||
class KondisiBangunan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'kondisi_bangunan';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [];
|
||||
|
||||
protected static function newFactory(): KondisiBangunanFactory
|
||||
{
|
||||
//return KondisiBangunanFactory::new();
|
||||
}
|
||||
}
|
||||
23
app/Models/KondisiFisikTanah.php
Normal file
23
app/Models/KondisiFisikTanah.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\KondisiFisikTanahFactory;
|
||||
|
||||
class KondisiFisikTanah extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'kondisi_fisik_tanah';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): KondisiFisikTanahFactory
|
||||
{
|
||||
//return KondisiFisikTanahFactory::new();
|
||||
}
|
||||
}
|
||||
23
app/Models/KonturTanah.php
Normal file
23
app/Models/KonturTanah.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\KonturTanahFactory;
|
||||
|
||||
class KonturTanah extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'kontur_tanah';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): KonturTanahFactory
|
||||
{
|
||||
//return KonturTanahFactory::new();
|
||||
}
|
||||
}
|
||||
23
app/Models/LaluLintasLokasi.php
Normal file
23
app/Models/LaluLintasLokasi.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\LaluLintasLokasiFactory;
|
||||
|
||||
class LaluLintasLokasi extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'lalu_lintas_lokasi';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): LaluLintasLokasiFactory
|
||||
{
|
||||
//return LaluLintasLokasiFactory::new();
|
||||
}
|
||||
}
|
||||
22
app/Models/PerkerasanJalan.php
Normal file
22
app/Models/PerkerasanJalan.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\PerkerasanJalanFactory;
|
||||
|
||||
class PerkerasanJalan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): PerkerasanJalanFactory
|
||||
{
|
||||
//return PerkerasanJalanFactory::new();
|
||||
}
|
||||
}
|
||||
24
app/Models/PosisiKavling.php
Normal file
24
app/Models/PosisiKavling.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\PosisiKavlingFactory;
|
||||
|
||||
class PosisiKavling extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'posisi_kavling';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): PosisiKavlingFactory
|
||||
{
|
||||
//return PosisiKavlingFactory::new();
|
||||
}
|
||||
}
|
||||
24
app/Models/SaranaPelengkap.php
Normal file
24
app/Models/SaranaPelengkap.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\SaranaPelengkapFactory;
|
||||
|
||||
class SaranaPelengkap extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'sarana_pelengkap';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): SaranaPelengkapFactory
|
||||
{
|
||||
//return SaranaPelengkapFactory::new();
|
||||
}
|
||||
}
|
||||
24
app/Models/SifatBangunan.php
Normal file
24
app/Models/SifatBangunan.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\SifatBangunanFactory;
|
||||
|
||||
class SifatBangunan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'sifat_bangunan';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): SifatBangunanFactory
|
||||
{
|
||||
//return SifatBangunanFactory::new();
|
||||
}
|
||||
}
|
||||
31
app/Models/SpekBangunan.php
Normal file
31
app/Models/SpekBangunan.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\SpekBangunanFactory;
|
||||
|
||||
class SpekBangunan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'spek_bangunan';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [];
|
||||
|
||||
|
||||
|
||||
public function bangunanKategori(){
|
||||
return $this->belongsTo(SpekKategoriBangunan::class, 'spek_kategori_bangunan_id');
|
||||
}
|
||||
|
||||
protected static function newFactory(): SpekBangunanFactory
|
||||
{
|
||||
//return SpekBangunanFactory::new();
|
||||
}
|
||||
|
||||
}
|
||||
28
app/Models/SpekKategoritBangunan.php
Normal file
28
app/Models/SpekKategoritBangunan.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\SpekKategoritBangunanFactory;
|
||||
|
||||
class SpekKategoritBangunan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'spek_kategori_bangunan';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [];
|
||||
|
||||
|
||||
public function bangunan()
|
||||
{
|
||||
return $this->hasMany(SpekBangunan::class, 'spek_kategori_bangunan_id');
|
||||
}
|
||||
protected static function newFactory(): SpekKategoritBangunanFactory
|
||||
{
|
||||
//return SpekKategoritBangunanFactory::new();
|
||||
}
|
||||
}
|
||||
22
app/Models/TingkatKeramaian.php
Normal file
22
app/Models/TingkatKeramaian.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\TingkatKeramaianFactory;
|
||||
|
||||
class TingkatKeramaian extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['code', 'name', 'status'];
|
||||
|
||||
protected static function newFactory(): TingkatKeramaianFactory
|
||||
{
|
||||
//return TingkatKeramaianFactory::new();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user