Files
ignacionelson 6e47d76ba6 ProjectSend 2.0.0
Client file sharing, rebuilt from the ground up: a private area per
client, resumable uploads, folders, groups and categories, sharing with
expiry dates and download limits, comments, file versions, an activity
log, a REST API, and sixteen languages.

This repository begins here. ProjectSend 2 was developed privately, and
that development history is not published — the previous generation
remains available, with its own history, at projectsend/legacy.

Free software under the GNU General Public License v2, or (at your
option) any later version.
2026-08-14 01:38:12 -03:00

51 lines
1.4 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Modules\Clients\Models;
use App\Modules\Clients\ClientCustomFieldType;
use App\Modules\Clients\ClientFieldEditability;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;
/**
* A field definition shown on the staff-facing client create/edit
* screens, and optionally also on the client-facing registration and/or
* account pages (see `client_editability`/`client_contexts`). Configuration
* data — hard-deleted; deleting one cascades its per-client values.
*
* @property int $id
* @property string $name
* @property string $label
* @property ClientCustomFieldType $type
* @property list<string>|null $options
* @property bool $required
* @property int $sort_order
* @property ClientFieldEditability $client_editability
* @property list<string>|null $client_contexts
*/
class ClientCustomField extends Model
{
protected $guarded = [];
protected function casts(): array
{
return [
'type' => ClientCustomFieldType::class,
'options' => 'array',
'required' => 'boolean',
'client_editability' => ClientFieldEditability::class,
'client_contexts' => 'array',
];
}
/**
* @return HasMany<ClientCustomFieldValue, $this>
*/
public function values(): HasMany
{
return $this->hasMany(ClientCustomFieldValue::class);
}
}