ekosistem dan framework
This commit is contained in:
@@ -23,7 +23,7 @@ class ValueBasisDataController extends Controller
|
||||
{
|
||||
public function index(Request $request, string $tabelId): View
|
||||
{
|
||||
if (!Gate::any(['super_admin', 'admin'])) {
|
||||
if (!Gate::any(['super_admin', 'admin', 'fasilitator'])) {
|
||||
abort(403);
|
||||
}
|
||||
|
||||
@@ -44,13 +44,15 @@ class ValueBasisDataController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
$tabel = TabelBasisData::find($tabelId);
|
||||
$tabel = TabelBasisData::with('kolom')
|
||||
->whereHas('kolom', function ($query) {
|
||||
$query->where('is_active', true);
|
||||
})->find($tabelId);
|
||||
if (!$tabel) {
|
||||
abort(404, 'Data tabel tidak ditemukan.');
|
||||
}
|
||||
$kolom = KolomBasisData::where('tabel_id', $tabelId)
|
||||
$kolom = KolomBasisData::where('tabel_id', $tabel->id)
|
||||
->where('is_active', true)
|
||||
->where('is_browse', true)
|
||||
->get();
|
||||
if ($kolom->isEmpty()) {
|
||||
abort(404, 'Data kolom tidak ditemukan untuk tabel ini.');
|
||||
@@ -165,7 +167,10 @@ class ValueBasisDataController extends Controller
|
||||
abort(403);
|
||||
}
|
||||
|
||||
$tabel = TabelBasisData::find($tabelId);
|
||||
$tabel = TabelBasisData::with('kolom')
|
||||
->whereHas('kolom', function ($query) {
|
||||
$query->where('is_active', true);
|
||||
})->find($tabelId);
|
||||
if (!$tabel) {
|
||||
abort(404, 'Data tabel tidak ditemukan.');
|
||||
}
|
||||
@@ -213,7 +218,10 @@ class ValueBasisDataController extends Controller
|
||||
abort(403);
|
||||
}
|
||||
|
||||
$tabel = TabelBasisData::find($tabelId);
|
||||
$tabel = TabelBasisData::with('kolom')
|
||||
->whereHas('kolom', function ($query) {
|
||||
$query->where('is_active', true);
|
||||
})->find($tabelId);
|
||||
if (!$tabel) {
|
||||
abort(404, 'Data tabel tidak ditemukan.');
|
||||
}
|
||||
@@ -282,7 +290,10 @@ class ValueBasisDataController extends Controller
|
||||
abort(403);
|
||||
}
|
||||
|
||||
$tabel = TabelBasisData::find($tabelId);
|
||||
$tabel = TabelBasisData::with('kolom')
|
||||
->whereHas('kolom', function ($query) {
|
||||
$query->where('is_active', true);
|
||||
})->find($tabelId);
|
||||
if (!$tabel) {
|
||||
abort(404, 'Data tabel tidak ditemukan.');
|
||||
}
|
||||
@@ -339,7 +350,10 @@ class ValueBasisDataController extends Controller
|
||||
abort(403);
|
||||
}
|
||||
|
||||
$tabel = TabelBasisData::find($tabelId);
|
||||
$tabel = TabelBasisData::with('kolom')
|
||||
->whereHas('kolom', function ($query) {
|
||||
$query->where('is_active', true);
|
||||
})->find($tabelId);
|
||||
if (!$tabel) {
|
||||
abort(404, 'Data tabel tidak ditemukan.');
|
||||
}
|
||||
@@ -402,7 +416,10 @@ class ValueBasisDataController extends Controller
|
||||
abort(403);
|
||||
}
|
||||
|
||||
$tabel = TabelBasisData::find($tabelId);
|
||||
$tabel = TabelBasisData::with('kolom')
|
||||
->whereHas('kolom', function ($query) {
|
||||
$query->where('is_active', true);
|
||||
})->find($tabelId);
|
||||
if (!$tabel) {
|
||||
abort(404, 'Data tabel tidak ditemukan.');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user