Changeset View
Changeset View
Standalone View
Standalone View
src/app/Resource.php
<?php | <?php | ||||
namespace App; | namespace App; | ||||
use App\Traits\BelongsToTenantTrait; | use App\Traits\BelongsToTenantTrait; | ||||
use App\Traits\EntitleableTrait; | use App\Traits\EntitleableTrait; | ||||
use App\Traits\EmailPropertyTrait; | use App\Traits\EmailPropertyTrait; | ||||
use App\Traits\ResourceConfigTrait; | use App\Traits\ResourceConfigTrait; | ||||
use App\Traits\SettingsTrait; | use App\Traits\SettingsTrait; | ||||
use App\Traits\StatusPropertyTrait; | use App\Traits\StatusPropertyTrait; | ||||
use App\Traits\UuidIntKeyTrait; | use App\Traits\UuidIntKeyTrait; | ||||
use App\Wallet; | |||||
use Illuminate\Database\Eloquent\Model; | use Illuminate\Database\Eloquent\Model; | ||||
use Illuminate\Database\Eloquent\SoftDeletes; | use Illuminate\Database\Eloquent\SoftDeletes; | ||||
/** | /** | ||||
* The eloquent definition of a Resource. | * The eloquent definition of a Resource. | ||||
* | * | ||||
* @property int $id The resource identifier | * @property int $id The resource identifier | ||||
* @property string $email An email address | * @property string $email An email address | ||||
Show All 23 Lines | class Resource extends Model | ||||
// resource has been created in LDAP | // resource has been created in LDAP | ||||
public const STATUS_LDAP_READY = 1 << 4; | public const STATUS_LDAP_READY = 1 << 4; | ||||
// resource has been created in IMAP | // resource has been created in IMAP | ||||
public const STATUS_IMAP_READY = 1 << 8; | public const STATUS_IMAP_READY = 1 << 8; | ||||
// A template for the email attribute on a resource creation | // A template for the email attribute on a resource creation | ||||
public const EMAIL_TEMPLATE = 'resource-{id}@{domainName}'; | public const EMAIL_TEMPLATE = 'resource-{id}@{domainName}'; | ||||
protected $fillable = [ | /** @var array<string, string> The attributes that should be cast */ | ||||
'email', | protected $casts = [ | ||||
'name', | 'created_at' => 'datetime:Y-m-d H:i:s', | ||||
'status', | 'deleted_at' => 'datetime:Y-m-d H:i:s', | ||||
'updated_at' => 'datetime:Y-m-d H:i:s', | |||||
]; | ]; | ||||
/** @var array<int, string> The attributes that are mass assignable */ | |||||
protected $fillable = ['email', 'name', 'status']; | |||||
} | } |