<?php

namespace App\Http\Controllers\Backend;

use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;

class ResumeController extends Controller
{
    public function index()
    {
        $userId = Auth::id();

        $rangkumanList = DB::table('hasil')
            ->where('id_user', $userId)
            ->pluck('rangkuman')
            ->filter(function ($item) {
                return !is_null($item) && trim($item) !== '';
            });

        return view('backend.resumepembelajaran', compact('rangkumanList'));
    }
}
