feat: Implement resource locking and add role-based journalist filtering.
This commit is contained in:
parent
ab4b04b1d8
commit
25b856acde
@ -258,7 +258,14 @@ public static function table(Table $table): Table
|
|||||||
->emptyStateIcon(Heroicon::Identification)
|
->emptyStateIcon(Heroicon::Identification)
|
||||||
->emptyStateDescription('Setelah Anda membubat data pertama, maka akan muncul disini.')
|
->emptyStateDescription('Setelah Anda membubat data pertama, maka akan muncul disini.')
|
||||||
->defaultSort('created_at', 'desc')
|
->defaultSort('created_at', 'desc')
|
||||||
->deferFilters(false);
|
->deferFilters(false)
|
||||||
|
->modifyQueryUsing(function (Builder $query) {
|
||||||
|
$query->when(auth()->user()->hasRole('Perusahaan'), function (Builder $q) {
|
||||||
|
return $q->whereHas('partnerMedia.company', function (Builder $q) {
|
||||||
|
$q->where('user_id', auth()->id());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getPages(): array
|
public static function getPages(): array
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user