mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-02-07 03:58:52 -06:00
- If the sender or receiver of the invite is deleted from site then use the System as a fallback for user invite trees and invites log
60 lines
1.2 KiB
PHP
Executable File
60 lines
1.2 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* NOTICE OF LICENSE
|
|
*
|
|
* UNIT3D is open-sourced software licensed under the GNU General Public License v3.0
|
|
* The details is bundled with this project in the file LICENSE.txt.
|
|
*
|
|
* @project UNIT3D
|
|
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
|
|
* @author HDVinnie
|
|
*/
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Invite extends Model
|
|
{
|
|
/**
|
|
* The database table used by the model.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $table = "invites";
|
|
|
|
/**
|
|
* Mass assignment fields
|
|
*
|
|
*/
|
|
protected $fillable = [
|
|
'user_id', 'email', 'code', 'expires_on', 'accepted_by', 'accepted_at', 'custom'
|
|
];
|
|
|
|
/**
|
|
* Belongs to User
|
|
*
|
|
*
|
|
*/
|
|
public function sender()
|
|
{
|
|
return $this->belongsTo(\App\User::class, 'user_id')->withDefault([
|
|
'username' => 'System',
|
|
'id' => '1'
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* Belongs to User
|
|
*
|
|
*
|
|
*/
|
|
public function reciever()
|
|
{
|
|
return $this->belongsTo(\App\User::class, 'accepted_by')->withDefault([
|
|
'username' => 'System',
|
|
'id' => '1'
|
|
]);
|
|
}
|
|
}
|