Skip to content

Commit 6e23e37

Browse files
committed
Added time entry api endpoints; Increased phpstan level; renamed to solidtime
1 parent efb06ed commit 6e23e37

36 files changed

+1717
-462
lines changed

.env.example

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
APP_NAME=Laravel
1+
APP_NAME=solidtime
22
APP_ENV=local
33
APP_KEY=base64:UNQNf1SXeASNkWux01Rj8EnHYx8FO0kAxWNDwktclkk=
44
APP_DEBUG=true
5-
APP_URL=http://localhost
5+
APP_URL=https://solidtime.test
6+
APP_FORCE_HTTPS=true
67

78
SUPER_ADMINS=[email protected]
89

@@ -60,6 +61,6 @@ VITE_PUSHER_PORT="${PUSHER_PORT}"
6061
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
6162
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
6263

63-
NGINX_HOST_NAME=timetracker.test
64+
NGINX_HOST_NAME=solidtime.test
6465
NETWORK_NAME=reverse-proxy-docker-traefik_routing
6566

LICENSE.txt renamed to LICENSE.md

Lines changed: 151 additions & 162 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ Additional System Requirements:
3434
Add the following entry to your `/etc/hosts`
3535

3636
```
37-
127.0.0.1 timetracker.test
38-
127.0.0.1 playwright.timetracker.test
37+
127.0.0.1 solidtime.test
38+
127.0.0.1 playwright.solidtime.test
3939
```
4040

4141
## Running E2E Tests
4242

43-
`./vendor/bin/sail up -d ` will automatically start a Playwright UI server that you can access at `https://playwright.timetracker.test`.
43+
`./vendor/bin/sail up -d ` will automatically start a Playwright UI server that you can access at `https://playwright.solidtime.test`.
4444
Make sure that you use HTTPS otherwise the resources will not be loaded correctly.
4545

4646
## Recording E2E Tests
@@ -49,7 +49,7 @@ To record E2E tests, you need to install and execute playwright locally (outside
4949

5050
```bash
5151
npx playwright install
52-
npx playwright codegen timetracker.test
52+
npx playwright codegen solidtime.test
5353
```
5454

5555
## Contributing

app/Actions/Fortify/PasswordValidationRules.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44

55
namespace App\Actions\Fortify;
66

7+
use Illuminate\Contracts\Validation\Rule;
78
use Illuminate\Validation\Rules\Password;
89

910
trait PasswordValidationRules
1011
{
1112
/**
1213
* Get the validation rules used to validate passwords.
1314
*
14-
* @return array<int, \Illuminate\Contracts\Validation\Rule|array|string>
15+
* @return array<int, Rule|string>
1516
*/
1617
protected function passwordRules(): array
1718
{

app/Actions/Jetstream/AddOrganizationMember.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use App\Models\Organization;
88
use App\Models\User;
99
use Closure;
10+
use Illuminate\Contracts\Validation\Rule;
1011
use Illuminate\Support\Facades\Gate;
1112
use Illuminate\Support\Facades\Validator;
1213
use Laravel\Jetstream\Contracts\AddsTeamMembers;
@@ -55,7 +56,7 @@ protected function validate(Organization $organization, string $email, ?string $
5556
/**
5657
* Get the validation rules for adding a team member.
5758
*
58-
* @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
59+
* @return array<string, array<Rule|string>>
5960
*/
6061
protected function rules(): array
6162
{

app/Actions/Jetstream/InviteOrganizationMember.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use App\Models\OrganizationInvitation;
99
use App\Models\User;
1010
use Closure;
11+
use Illuminate\Contracts\Validation\Rule;
1112
use Illuminate\Contracts\Validation\ValidationRule;
1213
use Illuminate\Database\Eloquent\Builder;
1314
use Illuminate\Support\Facades\Gate;
@@ -59,7 +60,7 @@ protected function validate(Organization $organization, string $email, ?string $
5960
/**
6061
* Get the validation rules for inviting a team member.
6162
*
62-
* @return array<string, ValidationRule|array|string>
63+
* @return array<string, array<ValidationRule|Rule|string>>
6364
*/
6465
protected function rules(Organization $organization): array
6566
{

app/Exceptions/ApiException.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Exceptions;
6+
7+
use Exception;
8+
use Illuminate\Http\JsonResponse;
9+
use Illuminate\Http\Request;
10+
11+
class ApiException extends Exception
12+
{
13+
/**
14+
* Render the exception into an HTTP response.
15+
*/
16+
public function render(Request $request): JsonResponse
17+
{
18+
return response()
19+
->json([
20+
'error' => true,
21+
'message' => $this->getMessage(),
22+
], 400);
23+
}
24+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Exceptions;
6+
7+
class TimeEntryStillRunning extends ApiException
8+
{
9+
}

app/Filament/Resources/OrganizationResource.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,16 @@ class OrganizationResource extends Resource
2525
public static function form(Form $form): Form
2626
{
2727
return $form
28+
->columns(1)
2829
->schema([
2930
Forms\Components\TextInput::make('name')
3031
->label('Name')
3132
->required()
3233
->maxLength(255),
33-
Forms\Components\Toggle::make('Is personal?')
34+
Forms\Components\Toggle::make('personal_team')
3435
->label('Is personal?')
3536
->required(),
36-
Forms\Components\Select::make('owner_id')
37+
Forms\Components\Select::make('user_id')
3738
->relationship(name: 'owner', titleAttribute: 'email')
3839
->searchable(['name', 'email'])
3940
->required(),
@@ -47,7 +48,8 @@ public static function table(Table $table): Table
4748
Tables\Columns\TextColumn::make('name')
4849
->searchable()
4950
->sortable(),
50-
Tables\Columns\ToggleColumn::make('is_personal')
51+
Tables\Columns\IconColumn::make('personal_team')
52+
->boolean()
5153
->label('Is personal?')
5254
->sortable(),
5355
Tables\Columns\TextColumn::make('owner.email')

app/Filament/Resources/UserResource.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class UserResource extends Resource
2525
public static function form(Form $form): Form
2626
{
2727
return $form
28+
->columns(1)
2829
->schema([
2930
Forms\Components\TextInput::make('id')
3031
->label('ID')

0 commit comments

Comments
 (0)