JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr{ gilour

File "UserWorkspacesController.php"

Full Path: /home/markqprx/iniasli.pro/Workspaces/Notifications/UserWorkspacesController.php
File size: 669 bytes
MIME-type: text/x-php
Charset: utf-8

<?php

namespace Common\Workspaces;

use Auth;
use Common\Core\BaseController;

class UserWorkspacesController extends BaseController
{
    public function __construct()
    {
        $this->middleware('auth');
    }

    public function index()
    {
        $workspaces = Workspace::forUser(Auth::id())
            ->with(['members'])
            ->withCount(['members'])
            ->limit(20)
            ->get()
            ->map(function (Workspace $workspace) {
                $workspace->setCurrentUserAndOwner();
                return $workspace;
            });

        return $this->success([
            'workspaces' => $workspaces,
        ]);
    }
}