diff --git a/app/Conversation.php b/app/Conversation.php index e3422216..59b9721b 100644 --- a/app/Conversation.php +++ b/app/Conversation.php @@ -289,7 +289,7 @@ class Conversation extends Model /** * Set conversation user and all related fields. - * + * * @param int $user_id */ public function setUser($user_id) diff --git a/app/Http/Controllers/ConversationsController.php b/app/Http/Controllers/ConversationsController.php index a0d5c37f..66c2b784 100644 --- a/app/Http/Controllers/ConversationsController.php +++ b/app/Http/Controllers/ConversationsController.php @@ -3,7 +3,6 @@ namespace App\Http\Controllers; use App\Conversation; -use Illuminate\Http\Request; class ConversationsController extends Controller { diff --git a/app/Http/Controllers/SecureController.php b/app/Http/Controllers/SecureController.php index 9e5b6549..1c2832fb 100644 --- a/app/Http/Controllers/SecureController.php +++ b/app/Http/Controllers/SecureController.php @@ -3,10 +3,10 @@ namespace App\Http\Controllers; use App\ActivityLog; -use Illuminate\Http\Request; use App\Conversation; use App\Events\ConversationStatusChanged; use App\Events\ConversationUserChanged; +use Illuminate\Http\Request; class SecureController extends Controller { @@ -92,7 +92,7 @@ class SecureController extends Controller case 'conversation_change_user': $conversation = Conversation::find($request->conversation_id); - $new_user_id = (int)$request->user_id; + $new_user_id = (int) $request->user_id; if (!$conversation) { $response['msg'] = 'Conversation not found'; diff --git a/app/Mailbox.php b/app/Mailbox.php index 8200e1ba..f6bdd4da 100644 --- a/app/Mailbox.php +++ b/app/Mailbox.php @@ -4,7 +4,6 @@ namespace App; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\Hash; -use App\User; class Mailbox extends Model { @@ -210,7 +209,7 @@ class Mailbox extends Model ->where('status', Conversation::STATUS_ACTIVE) ->where('user_id', $folder->user_id) ->count(); - // todo: starred conversations counting + // todo: starred conversations counting } else { $folder->active_count = $folder->conversations() ->where('status', Conversation::STATUS_ACTIVE) @@ -268,6 +267,7 @@ class Mailbox extends Model { $users = $this->users; $admins = User::where('role', User::ROLE_ADMIN)->get(); + return $users->merge($admins)->unique(); } @@ -278,6 +278,7 @@ class Mailbox extends Model { $user_ids = $this->users()->pluck('users.id'); $admin_ids = User::where('role', User::ROLE_ADMIN)->pluck('id'); + return $user_ids->merge($admin_ids)->unique()->toArray(); } } diff --git a/app/Thread.php b/app/Thread.php index a583fb97..ef3e033b 100644 --- a/app/Thread.php +++ b/app/Thread.php @@ -284,15 +284,15 @@ class Thread extends Model /** * Get text for the assignee. - * + * * @return string */ public function getAssignedName() { if (!$this->user_id) { - return __("anyone"); + return __('anyone'); } elseif ($this->user_id == auth()->user()->id) { - return __("yourself"); + return __('yourself'); } else { return $this->user->getFullName(); }