Changeset View
Changeset View
Standalone View
Standalone View
src/app/SharedFolderAlias.php
Show All 18 Lines | class SharedFolderAlias extends Model | ||||
/** | /** | ||||
* Ensure the email address is appropriately cased. | * Ensure the email address is appropriately cased. | ||||
* | * | ||||
* @param string $alias Email address | * @param string $alias Email address | ||||
*/ | */ | ||||
public function setAliasAttribute(string $alias) | public function setAliasAttribute(string $alias) | ||||
{ | { | ||||
$this->attributes['alias'] = \strtolower($alias); | $this->attributes['alias'] = \App\Utils::emailToLower($alias); | ||||
} | } | ||||
/** | /** | ||||
* The shared folder to which this alias belongs. | * The shared folder to which this alias belongs. | ||||
* | * | ||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo | ||||
*/ | */ | ||||
public function sharedFolder() | public function sharedFolder() | ||||
{ | { | ||||
return $this->belongsTo(SharedFolder::class, 'shared_folder_id', 'id'); | return $this->belongsTo(SharedFolder::class, 'shared_folder_id', 'id'); | ||||
} | } | ||||
} | } |