mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-02-08 20:49:10 -06:00
52 lines
1.1 KiB
PHP
52 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;
|
|
use Illuminate\Notifications\Notifiable;
|
|
|
|
class Chatroom extends Model
|
|
{
|
|
use Notifiable;
|
|
|
|
protected $table = 'chatrooms';
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $fillable = [
|
|
'name'
|
|
];
|
|
|
|
/**
|
|
* A user can have many messages
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
*/
|
|
public function messages()
|
|
{
|
|
return $this->hasMany(\App\Message::class);
|
|
}
|
|
|
|
/**
|
|
* A chatroom can have many users.
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
|
*/
|
|
public function users()
|
|
{
|
|
return $this->hasMany(User::class);
|
|
}
|
|
} |