<commit_before><?php

namespace App\Http\Controllers;

use \DB;

use Illuminate\Http\Request;
use Illuminate\Http\Response;

use App\Http\Requests;
use App\Http\Controllers\Controller;

class UsersController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $users = DB::table('users')->select('id', 'username')->distinct()->get();
        return $users;
    }
}<commit_msg>Added extra functionality to return a movie the user is subscribed. WIP<commit_after><?php

namespace App\Http\Controllers;

use \DB;

use Illuminate\Http\Request;
use Illuminate\Http\Response;

use App\Http\Requests;
use App\Http\Controllers\Controller;

class UsersController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $users = DB::table('users')->select('id', 'username')->distinct()->get();
        $movies = DB::table('movies')->select()->distinct()->get();

        foreach($users as $user){
            $user_movies = DB::table('user_movie')->select('movie_id', 'status')
                ->where('user_id', '=', $user->id)
                ->get();
            $user->movies = [];
            foreach($user_movies as $user_movie){
                $movie = DB::table('movies')->select()->distinct()
                    ->where('id', '=', $user_movie->movie_id)->get();
                $movie[0]->status = $user_movie->status;
                $user->movies = $movie;
            }
        }
        $responseArray = [
            'success'=> true,
            'users' => $users
        ];
        return $responseArray;
    }
}
{'fraction_non_alphanumeric': 0.16171428571428573, 'fraction_numerical': 0.0005714285714285715, 'mean_word_length': 2.335238095238095, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4139172', 'n_tokens_mistral': 515, 'n_tokens_neox': 518, 'n_words': 105}