diff --git a/app/Group.php b/app/Group.php
index 2b60450..195e49d 100644
--- a/app/Group.php
+++ b/app/Group.php
@@ -14,4 +14,9 @@ class Group extends Model
protected $fillable = [
'name'
];
+
+ public function users()
+ {
+ return $this->belongsToMany(User::class, 'user_groups');
+ }
}
\ No newline at end of file
diff --git a/app/Http/Controllers/Admin/DefaultController.php b/app/Http/Controllers/Admin/DefaultController.php
index f46acc2..d61e0d1 100644
--- a/app/Http/Controllers/Admin/DefaultController.php
+++ b/app/Http/Controllers/Admin/DefaultController.php
@@ -6,6 +6,7 @@ use App\Album;
use App\Configuration;
use App\Facade\Theme;
use App\Facade\UserConfig;
+use App\Group;
use App\Helpers\ConfigHelper;
use App\Http\Controllers\Controller;
use App\Http\Requests\SaveSettingsRequest;
@@ -33,11 +34,13 @@ class DefaultController extends Controller
$albumCount = Album::all()->count();
$photoCount = Photo::all()->count();
+ $groupCount = Group::all()->count();
$userCount = User::where('is_activated', true)->count();
return Theme::render('admin.index', [
'album_count' => $albumCount,
'app_version' => config('app.version'),
+ 'group_count' => $groupCount,
'memory_limit' => ini_get('memory_limit'),
'photo_count' => $photoCount,
'php_version' => phpversion(),
diff --git a/resources/lang/en/admin.php b/resources/lang/en/admin.php
index 9613678..91411d3 100644
--- a/resources/lang/en/admin.php
+++ b/resources/lang/en/admin.php
@@ -72,6 +72,11 @@ return [
'edit_user_title' => 'Edit user account: :name',
'group_deletion_failed' => 'An error occurred while removing the ":name" group: :error_message',
'group_deletion_successful' => 'The ":name" group was removed successfully.',
+ 'group_details_tab' => 'Details',
+ 'group_no_users_message' => 'This group has no users assigned to it. Assign users to this group by using the Groups tab on the Edit User page.',
+ 'group_number_users' => '{0} No users|{1} 1 user|[2,Inf] :count users',
+ 'group_users_message' => 'The users shown below are linked to this group. To remove a user, click the user\'s name and untick the ":group_name" group from the Groups tab.',
+ 'group_users_tab' => 'Users',
'inactive_storage_legend' => 'Inactive storage location that cannot be used for new albums.',
'is_uploading' => 'Uploading in progress...',
'legend' => 'Legend/Key',
@@ -127,6 +132,7 @@ return [
'settings_title' => 'Settings',
'stats_widget' => [
'albums' => 'album|albums',
+ 'groups' => 'group|groups',
'panel_header' => 'Statistics',
'photos' => 'photo|photos',
'users' => 'user|users',
diff --git a/resources/views/themes/base/admin/create_album.blade.php b/resources/views/themes/base/admin/create_album.blade.php
index 21739d1..69fa3a2 100644
--- a/resources/views/themes/base/admin/create_album.blade.php
+++ b/resources/views/themes/base/admin/create_album.blade.php
@@ -54,7 +54,7 @@