-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from dsbilling/filament3
- Loading branch information
Showing
164 changed files
with
3,408 additions
and
4,277 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: PHP Linting | ||
on: pull_request | ||
jobs: | ||
phplint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: "laravel-pint" | ||
uses: aglipanci/[email protected] | ||
with: | ||
preset: laravel | ||
verboseMode: true | ||
testMode: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
<?php | ||
|
||
namespace App\Filament\Resources; | ||
|
||
use App\Filament\Resources\CertificationResource\Pages; | ||
use App\Models\Certification; | ||
use Filament\Forms\Components\DatePicker; | ||
use Filament\Forms\Components\FileUpload; | ||
use Filament\Forms\Components\Select; | ||
use Filament\Forms\Components\TextInput; | ||
use Filament\Forms\Form; | ||
use Filament\Resources\Resource; | ||
use Filament\Tables; | ||
use Filament\Tables\Columns\TextColumn; | ||
use Filament\Tables\Table; | ||
|
||
class CertificationResource extends Resource | ||
{ | ||
protected static ?string $model = Certification::class; | ||
|
||
protected static ?string $navigationIcon = 'heroicon-o-book-open'; | ||
|
||
public static function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
TextInput::make('name') | ||
->autofocus() | ||
->required() | ||
->placeholder(__('Name')), | ||
|
||
TextInput::make('short') | ||
->placeholder(__('Short')), | ||
|
||
TextInput::make('identifier') | ||
->placeholder(__('Identifier')), | ||
|
||
DatePicker::make('issued_at') | ||
->required() | ||
->placeholder(__('Issued at')), | ||
|
||
DatePicker::make('expiration_at') | ||
->placeholder(__('Expiration at')), | ||
|
||
Select::make('company_id') | ||
->required() | ||
->relationship('company', 'name'), | ||
|
||
FileUpload::make('file_path') | ||
->required() | ||
->acceptedFileTypes(['application/pdf']) | ||
->directory('uploads') | ||
->preserveFilenames() | ||
->downloadable(), | ||
|
||
]); | ||
} | ||
|
||
public static function table(Table $table): Table | ||
{ | ||
return $table | ||
->columns([ | ||
TextColumn::make('name') | ||
->searchable() | ||
->sortable(), | ||
TextColumn::make('short') | ||
->searchable() | ||
->sortable(), | ||
TextColumn::make('issued_at') | ||
->searchable() | ||
->sortable() | ||
->date(), | ||
TextColumn::make('expiration_at') | ||
->searchable() | ||
->sortable() | ||
->date(), | ||
TextColumn::make('company.name') | ||
->searchable() | ||
->sortable(), | ||
]) | ||
->filters([ | ||
// | ||
]) | ||
->actions([ | ||
Tables\Actions\EditAction::make(), | ||
]) | ||
->bulkActions([ | ||
Tables\Actions\BulkActionGroup::make([ | ||
Tables\Actions\DeleteBulkAction::make(), | ||
]), | ||
]) | ||
->defaultSort('issued_at', 'desc'); | ||
} | ||
|
||
public static function getRelations(): array | ||
{ | ||
return [ | ||
// | ||
]; | ||
} | ||
|
||
public static function getPages(): array | ||
{ | ||
return [ | ||
'index' => Pages\ListCertifications::route('/'), | ||
'create' => Pages\CreateCertification::route('/create'), | ||
'edit' => Pages\EditCertification::route('/{record}/edit'), | ||
]; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
app/Filament/Resources/CertificationResource/Pages/CreateCertification.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace App\Filament\Resources\CertificationResource\Pages; | ||
|
||
use App\Filament\Resources\CertificationResource; | ||
use Filament\Resources\Pages\CreateRecord; | ||
|
||
class CreateCertification extends CreateRecord | ||
{ | ||
protected static string $resource = CertificationResource::class; | ||
} |
19 changes: 19 additions & 0 deletions
19
app/Filament/Resources/CertificationResource/Pages/EditCertification.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace App\Filament\Resources\CertificationResource\Pages; | ||
|
||
use App\Filament\Resources\CertificationResource; | ||
use Filament\Actions; | ||
use Filament\Resources\Pages\EditRecord; | ||
|
||
class EditCertification extends EditRecord | ||
{ | ||
protected static string $resource = CertificationResource::class; | ||
|
||
protected function getHeaderActions(): array | ||
{ | ||
return [ | ||
Actions\DeleteAction::make(), | ||
]; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
app/Filament/Resources/CertificationResource/Pages/ListCertifications.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace App\Filament\Resources\CertificationResource\Pages; | ||
|
||
use App\Filament\Resources\CertificationResource; | ||
use Filament\Actions; | ||
use Filament\Resources\Pages\ListRecords; | ||
|
||
class ListCertifications extends ListRecords | ||
{ | ||
protected static string $resource = CertificationResource::class; | ||
|
||
protected function getHeaderActions(): array | ||
{ | ||
return [ | ||
Actions\CreateAction::make(), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?php | ||
|
||
namespace App\Filament\Resources; | ||
|
||
use App\Filament\Resources\CompanyResource\Pages; | ||
use App\Filament\Resources\CompanyResource\RelationManagers\CertificationsRelationManager; | ||
use App\Filament\Resources\CompanyResource\RelationManagers\CoursesRelationManager; | ||
use App\Models\Company; | ||
use Filament\Forms\Components\TextInput; | ||
use Filament\Forms\Form; | ||
use Filament\Resources\Resource; | ||
use Filament\Tables; | ||
use Filament\Tables\Table; | ||
|
||
class CompanyResource extends Resource | ||
{ | ||
protected static ?string $model = Company::class; | ||
|
||
protected static ?string $navigationIcon = 'heroicon-o-building-office'; | ||
|
||
public static function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
TextInput::make('name') | ||
->autofocus() | ||
->required() | ||
->placeholder(__('Name')), | ||
]); | ||
} | ||
|
||
public static function table(Table $table): Table | ||
{ | ||
return $table | ||
->columns([ | ||
Tables\Columns\TextColumn::make('name') | ||
->searchable() | ||
->sortable(), | ||
|
||
Tables\Columns\TextColumn::make('created_at') | ||
->searchable() | ||
->sortable() | ||
->dateTime(), | ||
|
||
Tables\Columns\TextColumn::make('updated_at') | ||
->searchable() | ||
->sortable() | ||
->dateTime(), | ||
]) | ||
->filters([ | ||
// | ||
]) | ||
->actions([ | ||
Tables\Actions\EditAction::make(), | ||
]) | ||
->bulkActions([ | ||
Tables\Actions\BulkActionGroup::make([ | ||
Tables\Actions\DeleteBulkAction::make(), | ||
]), | ||
]) | ||
->defaultSort('created_at', 'desc'); | ||
} | ||
|
||
public static function getRelations(): array | ||
{ | ||
return [ | ||
CertificationsRelationManager::make(), | ||
CoursesRelationManager::make(), | ||
]; | ||
} | ||
|
||
public static function getPages(): array | ||
{ | ||
return [ | ||
'index' => Pages\ListCompanies::route('/'), | ||
'create' => Pages\CreateCompany::route('/create'), | ||
'edit' => Pages\EditCompany::route('/{record}/edit'), | ||
]; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
app/Filament/Resources/CompanyResource/Pages/CreateCompany.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace App\Filament\Resources\CompanyResource\Pages; | ||
|
||
use App\Filament\Resources\CompanyResource; | ||
use Filament\Resources\Pages\CreateRecord; | ||
|
||
class CreateCompany extends CreateRecord | ||
{ | ||
protected static string $resource = CompanyResource::class; | ||
} |
19 changes: 19 additions & 0 deletions
19
app/Filament/Resources/CompanyResource/Pages/EditCompany.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace App\Filament\Resources\CompanyResource\Pages; | ||
|
||
use App\Filament\Resources\CompanyResource; | ||
use Filament\Actions; | ||
use Filament\Resources\Pages\EditRecord; | ||
|
||
class EditCompany extends EditRecord | ||
{ | ||
protected static string $resource = CompanyResource::class; | ||
|
||
protected function getHeaderActions(): array | ||
{ | ||
return [ | ||
Actions\DeleteAction::make(), | ||
]; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
app/Filament/Resources/CompanyResource/Pages/ListCompanies.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace App\Filament\Resources\CompanyResource\Pages; | ||
|
||
use App\Filament\Resources\CompanyResource; | ||
use Filament\Actions; | ||
use Filament\Resources\Pages\ListRecords; | ||
|
||
class ListCompanies extends ListRecords | ||
{ | ||
protected static string $resource = CompanyResource::class; | ||
|
||
protected function getHeaderActions(): array | ||
{ | ||
return [ | ||
Actions\CreateAction::make(), | ||
]; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
app/Filament/Resources/CompanyResource/RelationManagers/CertificationsRelationManager.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace App\Filament\Resources\CompanyResource\RelationManagers; | ||
|
||
use App\Filament\Resources\CertificationResource; | ||
use Filament\Forms\Form; | ||
use Filament\Resources\RelationManagers\RelationManager; | ||
use Filament\Tables\Table; | ||
|
||
class CertificationsRelationManager extends RelationManager | ||
{ | ||
protected static string $relationship = 'certifications'; | ||
|
||
public function form(Form $form): Form | ||
{ | ||
return CertificationResource::form($form); | ||
} | ||
|
||
public function table(Table $table): Table | ||
{ | ||
return CertificationResource::table($table); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
app/Filament/Resources/CompanyResource/RelationManagers/CoursesRelationManager.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace App\Filament\Resources\CompanyResource\RelationManagers; | ||
|
||
use App\Filament\Resources\CourseResource; | ||
use Filament\Forms\Form; | ||
use Filament\Resources\RelationManagers\RelationManager; | ||
use Filament\Tables\Table; | ||
|
||
class CoursesRelationManager extends RelationManager | ||
{ | ||
protected static string $relationship = 'courses'; | ||
|
||
public function form(Form $form): Form | ||
{ | ||
return CourseResource::form($form); | ||
} | ||
|
||
public function table(Table $table): Table | ||
{ | ||
return CourseResource::table($table); | ||
} | ||
} |
Oops, something went wrong.