mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-14 11:12:16 +01:00
Added telescope, basic project endpoint, basic filament resources, GitHub actions
This commit is contained in:
@@ -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',
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -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>
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user