whereUsername($username)->firstOrFail(); if($profile->status != null) { return ProfileController::accountCheck($profile); } if($profile->is_private) { return response()->json(['error'=>'403', 'msg' => 'private profile'], 403); } $timeline = $profile->statuses()->whereVisibility('public')->orderBy('created_at', 'desc')->paginate(10); $fractal = new Fractal\Manager(); $resource = new Fractal\Resource\Item($profile, new ProfileOutbox()); $res = $fractal->createData($resource)->toArray(); return $res['data']; } }