Added telescope, basic project endpoint, basic filament resources, GitHub actions

This commit is contained in:
Constantin Graf
2024-01-28 18:57:28 +01:00
parent e4f0eac834
commit e60e502612
80 changed files with 2563 additions and 135 deletions

View File

@@ -15,6 +15,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
/**
* @property string $id
* @property string $name
* @property string $color
* @property string $organization_id
* @property string $client_id
* @property-read Organization $organization
@@ -35,6 +36,7 @@ class Project extends Model
*/
protected $casts = [
'name' => 'string',
'color' => 'string',
];
/**

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Models;
use Carbon\CarbonInterval;
use Database\Factories\TimeEntryFactory;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
@@ -43,6 +44,11 @@ class TimeEntry extends Model
'tags' => 'array',
];
public function getDuration(): ?CarbonInterval
{
return $this->end === null ? null : $this->start->diffAsCarbonInterval($this->end);
}
/**
* @return BelongsTo<User, TimeEntry>
*/

View File

@@ -20,6 +20,7 @@ use Laravel\Passport\HasApiTokens;
/**
* @property string $id
* @property string $name
* @property string $email
*
* @method HasMany<Organization> ownedTeams()
* @method static UserFactory factory()
@@ -64,6 +65,7 @@ class User extends Authenticatable
*/
protected $casts = [
'email_verified_at' => 'datetime',
'is_admin' => 'boolean',
];
/**
@@ -77,8 +79,7 @@ class User extends Authenticatable
public function canAccessPanel(Panel $panel): bool
{
// TODO: Implement canAccessPanel() method.
return false;
return in_array($this->email, config('auth.super_admins', []), true);
}
/**