mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-01-21 19:40:47 -06:00
(Update) Removed facade to use proper dependency injection
This commit is contained in:
@@ -8,7 +8,7 @@ use App\Repositories\ChatRepository;
|
||||
use App\User;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Auth\AuthManager;
|
||||
|
||||
class ChatController extends Controller
|
||||
{
|
||||
@@ -23,9 +23,10 @@ class ChatController extends Controller
|
||||
*/
|
||||
private $auth;
|
||||
|
||||
public function __construct(ChatRepository $chat)
|
||||
public function __construct(ChatRepository $chat, AuthManager $auth)
|
||||
{
|
||||
$this->chat = $chat;
|
||||
$this->auth = $auth;
|
||||
}
|
||||
|
||||
/* STATUSES */
|
||||
@@ -55,7 +56,7 @@ class ChatController extends Controller
|
||||
{
|
||||
$uid = $request->get('user_id');
|
||||
|
||||
if (Auth::user()->id !== $uid) {
|
||||
if ($this->auth->user()->id !== $uid) {
|
||||
return response('error', 401);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user