fix(master-land): add user in data land

This commit is contained in:
arieeefajar 2025-04-22 14:28:49 +07:00
parent 810e7d1dc5
commit 9a424d3420
4 changed files with 16 additions and 2 deletions

View File

@ -15,7 +15,7 @@ class LandController extends Controller
{
public function index()
{
$lands = Land::with('province', 'regency')->orderBy('created_at', 'desc')->get();
$lands = Land::with('province', 'regency', 'user')->orderBy('created_at', 'desc')->get();
return view('master-data.lahan.index', compact('lands'));
}

View File

@ -31,4 +31,9 @@ public function district()
{
return $this->belongsTo(District::class, 'district_code', 'id');
}
public function user()
{
return $this->belongsTo(User::class);
}
}

View File

@ -29,7 +29,14 @@ checkAll &&
});
var perPage = 10,
options = {
valueNames: ["id", "land_name", "owner", "rental_price", "status"],
valueNames: [
"id",
"land_name",
"owner",
"rental_price",
"user",
"status",
],
page: perPage,
pagination: !0,
plugins: [ListPagination({ left: 2, right: 2 })],

View File

@ -49,6 +49,7 @@ class="ri-add-line align-bottom me-1"></i>
<th class="sort" data-sort="no">No</th>
<th class="sort" data-sort="owner">Pemilik</th>
<th class="sort" data-sort="address">Alamat</th>
<th class="sort" data-sort="user">Petugas</th>
<th class="sort" data-sort="action">Action</th>
</tr>
</thead>
@ -66,6 +67,7 @@ class="fw-medium link-primary">#VZ2101</a></td>
{{ ucwords(strtolower($land->regency->name)) }}, Provinsi
{{ ucwords(strtolower($land->province->name)) }}</span>
</td>
<td class="user">{{ $land->user->username }}</td>
<td>
<div class="d-flex gap-2 justify-content-center">
<div class="edit">