-
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added telescope, basic project endpoint, basic filament resources, Gi…
…tHub actions
- Loading branch information
Showing
64 changed files
with
2,069 additions
and
131 deletions.
There are no files selected for viewing
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
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
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
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,24 @@ | ||
name: Static code analysis (PHPStan) | ||
on: push | ||
jobs: | ||
phpstan: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: "Checkout code" | ||
uses: actions/checkout@v4 | ||
|
||
- name: "Setup PHP" | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.2' | ||
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv | ||
coverage: none | ||
|
||
- name: "Run composer install" | ||
run: composer install -n --prefer-dist | ||
|
||
- name: "Run PHPStan" | ||
run: composer analyse | ||
|
||
|
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,38 @@ | ||
name: PHPUnit Tests | ||
on: push | ||
jobs: | ||
phpunit: | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
mysql: | ||
image: postgres:15 | ||
env: | ||
PGPASSWORD: 'root' | ||
POSTGRES_DB: 'laravel' | ||
POSTGRES_USER: 'root' | ||
POSTGRES_PASSWORD: 'root' | ||
ports: | ||
- 5432:5432 | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- name: "Checkout code" | ||
uses: actions/checkout@v4 | ||
|
||
- name: "Setup PHP" | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.2' | ||
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv | ||
coverage: none | ||
|
||
- name: "Run composer install" | ||
run: composer install -n --prefer-dist | ||
|
||
- name: "Run PHPUnit" | ||
run: composer test |
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 |
---|---|---|
|
@@ -4,8 +4,10 @@ jobs: | |
pint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: "laravel-pint" | ||
- name: "Checkout code" | ||
uses: actions/checkout@v4 | ||
|
||
- name: "Check code style" | ||
uses: aglipanci/[email protected] | ||
with: | ||
configPath: "pint.json" |
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
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
/public/storage | ||
/public/css | ||
/public/js | ||
/public/vendor | ||
/lang/vendor | ||
/storage/*.key | ||
/vendor | ||
|
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,77 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Filament\Resources; | ||
|
||
use App\Filament\Resources\ClientResource\Pages; | ||
use App\Models\Client; | ||
use Filament\Forms\Form; | ||
use Filament\Resources\Resource; | ||
use Filament\Tables; | ||
use Filament\Tables\Table; | ||
|
||
class ClientResource extends Resource | ||
{ | ||
protected static ?string $model = Client::class; | ||
|
||
protected static ?string $navigationIcon = 'heroicon-o-briefcase'; | ||
|
||
protected static ?string $navigationGroup = 'Timetracking'; | ||
|
||
public static function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
// | ||
]); | ||
} | ||
|
||
public static function table(Table $table): Table | ||
{ | ||
return $table | ||
->columns([ | ||
Tables\Columns\TextColumn::make('name') | ||
->label('Name') | ||
->searchable() | ||
->sortable(), | ||
Tables\Columns\TextColumn::make('organization.name') | ||
->sortable() | ||
->label('Organization'), | ||
Tables\Columns\TextColumn::make('created_at') | ||
->label('Created at') | ||
->sortable(), | ||
Tables\Columns\TextColumn::make('updated_at') | ||
->label('Updated at') | ||
->sortable(), | ||
]) | ||
->defaultSort('created_at', 'desc') | ||
->filters([ | ||
// | ||
]) | ||
->actions([ | ||
Tables\Actions\EditAction::make(), | ||
]) | ||
->bulkActions([ | ||
Tables\Actions\BulkActionGroup::make([ | ||
Tables\Actions\DeleteBulkAction::make(), | ||
]), | ||
]); | ||
} | ||
|
||
public static function getRelations(): array | ||
{ | ||
return [ | ||
// | ||
]; | ||
} | ||
|
||
public static function getPages(): array | ||
{ | ||
return [ | ||
'index' => Pages\ListClients::route('/'), | ||
'create' => Pages\CreateClient::route('/create'), | ||
'edit' => Pages\EditClient::route('/{record}/edit'), | ||
]; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
app/Filament/Resources/ClientResource/Pages/CreateClient.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,13 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Filament\Resources\ClientResource\Pages; | ||
|
||
use App\Filament\Resources\ClientResource; | ||
use Filament\Resources\Pages\CreateRecord; | ||
|
||
class CreateClient extends CreateRecord | ||
{ | ||
protected static string $resource = ClientResource::class; | ||
} |
21 changes: 21 additions & 0 deletions
21
app/Filament/Resources/ClientResource/Pages/EditClient.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,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Filament\Resources\ClientResource\Pages; | ||
|
||
use App\Filament\Resources\ClientResource; | ||
use Filament\Actions; | ||
use Filament\Resources\Pages\EditRecord; | ||
|
||
class EditClient extends EditRecord | ||
{ | ||
protected static string $resource = ClientResource::class; | ||
|
||
protected function getHeaderActions(): array | ||
{ | ||
return [ | ||
Actions\DeleteAction::make(), | ||
]; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
app/Filament/Resources/ClientResource/Pages/ListClients.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,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Filament\Resources\ClientResource\Pages; | ||
|
||
use App\Filament\Resources\ClientResource; | ||
use Filament\Actions; | ||
use Filament\Resources\Pages\ListRecords; | ||
|
||
class ListClients extends ListRecords | ||
{ | ||
protected static string $resource = ClientResource::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,82 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Filament\Resources; | ||
|
||
use App\Filament\Resources\OrganizationResource\Pages; | ||
use App\Models\Organization; | ||
use Filament\Forms; | ||
use Filament\Forms\Form; | ||
use Filament\Resources\Resource; | ||
use Filament\Tables; | ||
use Filament\Tables\Table; | ||
|
||
class OrganizationResource extends Resource | ||
{ | ||
protected static ?string $model = Organization::class; | ||
|
||
protected static ?string $navigationIcon = 'heroicon-o-building-office-2'; | ||
|
||
protected static ?string $navigationGroup = 'Users'; | ||
|
||
public static function form(Form $form): Form | ||
{ | ||
return $form | ||
->schema([ | ||
Forms\Components\TextInput::make('name') | ||
->label('Name') | ||
->required() | ||
->maxLength(255), | ||
Forms\Components\Toggle::make('Is personal?') | ||
->label('Is personal?') | ||
->required(), | ||
Forms\Components\Select::make('owner_id') | ||
->relationship(name: 'owner', titleAttribute: 'email') | ||
->searchable(['name', 'email']) | ||
->required(), | ||
]); | ||
} | ||
|
||
public static function table(Table $table): Table | ||
{ | ||
return $table | ||
->columns([ | ||
Tables\Columns\TextColumn::make('name') | ||
->searchable() | ||
->sortable(), | ||
Tables\Columns\ToggleColumn::make('is_personal') | ||
->label('Is personal?') | ||
->sortable(), | ||
Tables\Columns\TextColumn::make('owner.email') | ||
->sortable(), | ||
]) | ||
->filters([ | ||
// | ||
]) | ||
->actions([ | ||
Tables\Actions\EditAction::make(), | ||
]) | ||
->bulkActions([ | ||
Tables\Actions\BulkActionGroup::make([ | ||
Tables\Actions\DeleteBulkAction::make(), | ||
]), | ||
]); | ||
} | ||
|
||
public static function getRelations(): array | ||
{ | ||
return [ | ||
// | ||
]; | ||
} | ||
|
||
public static function getPages(): array | ||
{ | ||
return [ | ||
'index' => Pages\ListOrganizations::route('/'), | ||
'create' => Pages\CreateOrganization::route('/create'), | ||
'edit' => Pages\EditOrganization::route('/{record}/edit'), | ||
]; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
app/Filament/Resources/OrganizationResource/Pages/CreateOrganization.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,13 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Filament\Resources\OrganizationResource\Pages; | ||
|
||
use App\Filament\Resources\OrganizationResource; | ||
use Filament\Resources\Pages\CreateRecord; | ||
|
||
class CreateOrganization extends CreateRecord | ||
{ | ||
protected static string $resource = OrganizationResource::class; | ||
} |
21 changes: 21 additions & 0 deletions
21
app/Filament/Resources/OrganizationResource/Pages/EditOrganization.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,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Filament\Resources\OrganizationResource\Pages; | ||
|
||
use App\Filament\Resources\OrganizationResource; | ||
use Filament\Actions; | ||
use Filament\Resources\Pages\EditRecord; | ||
|
||
class EditOrganization extends EditRecord | ||
{ | ||
protected static string $resource = OrganizationResource::class; | ||
|
||
protected function getHeaderActions(): array | ||
{ | ||
return [ | ||
Actions\DeleteAction::make(), | ||
]; | ||
} | ||
} |
Oops, something went wrong.