1
0
mirror of https://github.com/flarum/core.git synced 2025-10-12 23:44:27 +02:00

Move Group to its own namespace

We’ll need to add commands etc. for group management in the future
This commit is contained in:
Toby Zerner
2015-07-04 19:30:58 +09:30
parent 81170980e0
commit 04501545e3
4 changed files with 6 additions and 3 deletions

View File

@@ -1,36 +0,0 @@
<?php namespace Flarum\Core\Users;
use Flarum\Core\Model;
class Group extends Model
{
/**
* {@inheritdoc}
*/
protected $table = 'groups';
/**
* The ID of the administrator group.
*/
const ADMINISTRATOR_ID = 1;
/**
* The ID of the guest group.
*/
const GUEST_ID = 2;
/**
* The ID of the member group.
*/
const MEMBER_ID = 3;
/**
* Define the relationship with the group's users.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function users()
{
return $this->belongsToMany('Flarum\Core\Users\User', 'users_groups');
}
}

View File

@@ -1,5 +1,7 @@
<?php namespace Flarum\Core\Users;
use Flarum\Core\Groups\Group;
class Guest extends User
{
/**

View File

@@ -1,5 +1,6 @@
<?php namespace Flarum\Core\Users;
use Flarum\Core\Groups\Group;
use Flarum\Core\Model;
use Flarum\Core\Notifications\Notification;
use Illuminate\Contracts\Hashing\Hasher;
@@ -487,7 +488,7 @@ class User extends Model
*/
public function groups()
{
return $this->belongsToMany('Flarum\Core\Users\Group', 'users_groups');
return $this->belongsToMany('Flarum\Core\Groups\Group', 'users_groups');
}
/**