Files
UNIT3D-Community-Edition/app/Note.php
2018-12-06 14:42:13 +00:00

53 lines
1.1 KiB
PHP

<?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 Note extends Model
{
/**
* The Database Table Used By The Model.
*
* @var string
*/
protected $table = 'user_notes';
/**
* Belongs To A User.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function noteduser()
{
return $this->belongsTo(User::class, 'user_id')->withDefault([
'username' => 'System',
'id' => '1',
]);
}
/**
* Belongs To A User.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function staffuser()
{
return $this->belongsTo(User::class, 'staff_id')->withDefault([
'username' => 'System',
'id' => '1',
]);
}
}