Skip to content

Commit

Permalink
Merge pull request #21 from achmadhadikurnia/main
Browse files Browse the repository at this point in the history
Update: SubHeading from trait
  • Loading branch information
achmadhadikurnia authored Feb 19, 2024
2 parents e040948 + 118be60 commit b3d8e10
Show file tree
Hide file tree
Showing 24 changed files with 82 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Filament/Resources/AgamaResource/Pages/ManageAgamas.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
use Filament\Resources\Pages\ManageRecords;
use Illuminate\Support\Facades\Artisan;
use Kanekescom\Siasn\Referensi\Filament\Resources\AgamaResource;
use Kanekescom\Siasn\Referensi\Filament\Traits\HasSubheadingWithLatestSync;

class ManageAgamas extends ManageRecords
{
use HasSubheadingWithLatestSync;

protected static string $resource = AgamaResource::class;

protected function getHeaderActions(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
use Filament\Resources\Pages\ManageRecords;
use Illuminate\Support\Facades\Artisan;
use Kanekescom\Siasn\Referensi\Filament\Resources\AlasanHukumanDisiplinResource;
use Kanekescom\Siasn\Referensi\Filament\Traits\HasSubheadingWithLatestSync;

class ManageAlasanHukumanDisiplins extends ManageRecords
{
use HasSubheadingWithLatestSync;

protected static string $resource = AlasanHukumanDisiplinResource::class;

protected function getHeaderActions(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
use Filament\Resources\Pages\ManageRecords;
use Illuminate\Support\Facades\Artisan;
use Kanekescom\Siasn\Referensi\Filament\Resources\AsnJenisJabatanResource;
use Kanekescom\Siasn\Referensi\Filament\Traits\HasSubheadingWithLatestSync;

class ManageAsnJenisJabatans extends ManageRecords
{
use HasSubheadingWithLatestSync;

protected static string $resource = AsnJenisJabatanResource::class;

protected function getHeaderActions(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
use Filament\Resources\Pages\ManageRecords;
use Illuminate\Support\Facades\Artisan;
use Kanekescom\Siasn\Referensi\Filament\Resources\AsnJenjangJabatanResource;
use Kanekescom\Siasn\Referensi\Filament\Traits\HasSubheadingWithLatestSync;

class ManageAsnJenjangJabatans extends ManageRecords
{
use HasSubheadingWithLatestSync;

protected static string $resource = AsnJenjangJabatanResource::class;

protected function getHeaderActions(): array
Expand Down
3 changes: 3 additions & 0 deletions src/Filament/Resources/EselonResource/Pages/ManageEselons.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
use Filament\Resources\Pages\ManageRecords;
use Illuminate\Support\Facades\Artisan;
use Kanekescom\Siasn\Referensi\Filament\Resources\EselonResource;
use Kanekescom\Siasn\Referensi\Filament\Traits\HasSubheadingWithLatestSync;

class ManageEselons extends ManageRecords
{
use HasSubheadingWithLatestSync;

protected static string $resource = EselonResource::class;

protected function getHeaderActions(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
use Filament\Resources\Pages\ManageRecords;
use Illuminate\Support\Facades\Artisan;
use Kanekescom\Siasn\Referensi\Filament\Resources\GolonganResource;
use Kanekescom\Siasn\Referensi\Filament\Traits\HasSubheadingWithLatestSync;

class ManageGolongans extends ManageRecords
{
use HasSubheadingWithLatestSync;

protected static string $resource = GolonganResource::class;

protected function getHeaderActions(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
use Filament\Resources\Pages\ManageRecords;
use Illuminate\Support\Facades\Artisan;
use Kanekescom\Siasn\Referensi\Filament\Resources\InstansiResource;
use Kanekescom\Siasn\Referensi\Filament\Traits\HasSubheadingWithLatestSync;

class ManageInstansis extends ManageRecords
{
use HasSubheadingWithLatestSync;

protected static string $resource = InstansiResource::class;

protected function getHeaderActions(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
use Filament\Resources\Pages\ManageRecords;
use Illuminate\Support\Facades\Artisan;
use Kanekescom\Siasn\Referensi\Filament\Resources\JabatanFungsionalResource;
use Kanekescom\Siasn\Referensi\Filament\Traits\HasSubheadingWithLatestSync;

class ManageJabatanFungsionals extends ManageRecords
{
use HasSubheadingWithLatestSync;

protected static string $resource = JabatanFungsionalResource::class;

protected function getHeaderActions(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
use Filament\Resources\Pages\ManageRecords;
use Illuminate\Support\Facades\Artisan;
use Kanekescom\Siasn\Referensi\Filament\Resources\JabatanFungsionalUmumResource;
use Kanekescom\Siasn\Referensi\Filament\Traits\HasSubheadingWithLatestSync;

class ManageJabatanFungsionalUmums extends ManageRecords
{
use HasSubheadingWithLatestSync;

protected static string $resource = JabatanFungsionalUmumResource::class;

protected function getHeaderActions(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
use Filament\Resources\Pages\ManageRecords;
use Illuminate\Support\Facades\Artisan;
use Kanekescom\Siasn\Referensi\Filament\Resources\JenisAnakResource;
use Kanekescom\Siasn\Referensi\Filament\Traits\HasSubheadingWithLatestSync;

class ManageJenisAnaks extends ManageRecords
{
use HasSubheadingWithLatestSync;

protected static string $resource = JenisAnakResource::class;

protected function getHeaderActions(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
use Filament\Resources\Pages\ManageRecords;
use Illuminate\Support\Facades\Artisan;
use Kanekescom\Siasn\Referensi\Filament\Resources\JenisDiklatResource;
use Kanekescom\Siasn\Referensi\Filament\Traits\HasSubheadingWithLatestSync;

class ManageJenisDiklats extends ManageRecords
{
use HasSubheadingWithLatestSync;

protected static string $resource = JenisDiklatResource::class;

protected function getHeaderActions(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
use Filament\Resources\Pages\ManageRecords;
use Illuminate\Support\Facades\Artisan;
use Kanekescom\Siasn\Referensi\Filament\Resources\JenisHukumanResource;
use Kanekescom\Siasn\Referensi\Filament\Traits\HasSubheadingWithLatestSync;

class ManageJenisHukumen extends ManageRecords
{
use HasSubheadingWithLatestSync;

protected static string $resource = JenisHukumanResource::class;

protected function getHeaderActions(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
use Filament\Resources\Pages\ManageRecords;
use Illuminate\Support\Facades\Artisan;
use Kanekescom\Siasn\Referensi\Filament\Resources\JenisJabatanResource;
use Kanekescom\Siasn\Referensi\Filament\Traits\HasSubheadingWithLatestSync;

class ManageJenisJabatans extends ManageRecords
{
use HasSubheadingWithLatestSync;

protected static string $resource = JenisJabatanResource::class;

protected function getHeaderActions(): array
Expand Down
3 changes: 3 additions & 0 deletions src/Filament/Resources/KanregResource/Pages/ManageKanregs.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
use Filament\Resources\Pages\ManageRecords;
use Illuminate\Support\Facades\Artisan;
use Kanekescom\Siasn\Referensi\Filament\Resources\KanregResource;
use Kanekescom\Siasn\Referensi\Filament\Traits\HasSubheadingWithLatestSync;

class ManageKanregs extends ManageRecords
{
use HasSubheadingWithLatestSync;

protected static string $resource = KanregResource::class;

protected function getHeaderActions(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
use Filament\Resources\Pages\ManageRecords;
use Illuminate\Support\Facades\Artisan;
use Kanekescom\Siasn\Referensi\Filament\Resources\KedudukanHukumResource;
use Kanekescom\Siasn\Referensi\Filament\Traits\HasSubheadingWithLatestSync;

class ManageKedudukanHukums extends ManageRecords
{
use HasSubheadingWithLatestSync;

protected static string $resource = KedudukanHukumResource::class;

protected function getHeaderActions(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
use Filament\Resources\Pages\ManageRecords;
use Illuminate\Support\Facades\Artisan;
use Kanekescom\Siasn\Referensi\Filament\Resources\KelJabatanResource;
use Kanekescom\Siasn\Referensi\Filament\Traits\HasSubheadingWithLatestSync;

class ManageKelJabatans extends ManageRecords
{
use HasSubheadingWithLatestSync;

protected static string $resource = KelJabatanResource::class;

protected function getHeaderActions(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
use Filament\Resources\Pages\ManageRecords;
use Illuminate\Support\Facades\Artisan;
use Kanekescom\Siasn\Referensi\Filament\Resources\LatihanStrukturalResource;
use Kanekescom\Siasn\Referensi\Filament\Traits\HasSubheadingWithLatestSync;

class ManageLatihanStrukturals extends ManageRecords
{
use HasSubheadingWithLatestSync;

protected static string $resource = LatihanStrukturalResource::class;

protected function getHeaderActions(): array
Expand Down
3 changes: 3 additions & 0 deletions src/Filament/Resources/LokasiResource/Pages/ManageLokasis.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
use Filament\Resources\Pages\ManageRecords;
use Illuminate\Support\Facades\Artisan;
use Kanekescom\Siasn\Referensi\Filament\Resources\LokasiResource;
use Kanekescom\Siasn\Referensi\Filament\Traits\HasSubheadingWithLatestSync;

class ManageLokasis extends ManageRecords
{
use HasSubheadingWithLatestSync;

protected static string $resource = LokasiResource::class;

protected function getHeaderActions(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
use Filament\Resources\Pages\ManageRecords;
use Illuminate\Support\Facades\Artisan;
use Kanekescom\Siasn\Referensi\Filament\Resources\PendidikanResource;
use Kanekescom\Siasn\Referensi\Filament\Traits\HasSubheadingWithLatestSync;

class ManagePendidikans extends ManageRecords
{
use HasSubheadingWithLatestSync;

protected static string $resource = PendidikanResource::class;

protected function getHeaderActions(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
use Filament\Resources\Pages\ManageRecords;
use Illuminate\Support\Facades\Artisan;
use Kanekescom\Siasn\Referensi\Filament\Resources\RefDokumenResource;
use Kanekescom\Siasn\Referensi\Filament\Traits\HasSubheadingWithLatestSync;

class ManageRefDokumens extends ManageRecords
{
use HasSubheadingWithLatestSync;

protected static string $resource = RefDokumenResource::class;

protected function getHeaderActions(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
use Filament\Resources\Pages\ManageRecords;
use Illuminate\Support\Facades\Artisan;
use Kanekescom\Siasn\Referensi\Filament\Resources\RefJenjangJfResource;
use Kanekescom\Siasn\Referensi\Filament\Traits\HasSubheadingWithLatestSync;

class ManageRefJenjangJfs extends ManageRecords
{
use HasSubheadingWithLatestSync;

protected static string $resource = RefJenjangJfResource::class;

protected function getHeaderActions(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
use Filament\Resources\Pages\ManageRecords;
use Illuminate\Support\Facades\Artisan;
use Kanekescom\Siasn\Referensi\Filament\Resources\SatuanKerjaResource;
use Kanekescom\Siasn\Referensi\Filament\Traits\HasSubheadingWithLatestSync;

class ManageSatuanKerjas extends ManageRecords
{
use HasSubheadingWithLatestSync;

protected static string $resource = SatuanKerjaResource::class;

protected function getHeaderActions(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
use Filament\Resources\Pages\ManageRecords;
use Illuminate\Support\Facades\Artisan;
use Kanekescom\Siasn\Referensi\Filament\Resources\TingkatPendidikanResource;
use Kanekescom\Siasn\Referensi\Filament\Traits\HasSubheadingWithLatestSync;

class ManageTingkatPendidikans extends ManageRecords
{
use HasSubheadingWithLatestSync;

protected static string $resource = TingkatPendidikanResource::class;

protected function getHeaderActions(): array
Expand Down
13 changes: 13 additions & 0 deletions src/Filament/Traits/HasSubheadingWithLatestSync.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Kanekescom\Siasn\Referensi\Filament\Traits;

use Illuminate\Contracts\Support\Htmlable;

trait HasSubheadingWithLatestSync
{
public function getSubheading(): string|Htmlable|null
{
return __('Last sync: ').(new (self::$resource::getModel()))->latest()->first()?->updated_at->diffForHumans();
}
}

0 comments on commit b3d8e10

Please sign in to comment.