<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\Master\Template;
use App\Models\Master\Topik;
use App\Models\Master\Instansi;
use App\Models\Dataset;

class FrontController extends Controller
{
    function index() {

        $data = [];
        $data['topik'] = Topik::all();
        $data['template'] = Template::all();
        $data['dataset'] = Dataset::orderBy('DatasetId','DESC')->limit(5)->get();


        return view('index',$data);
    }
    function search() {
        $data['topik'] = Topik::all();
        $data['template'] = Template::all();
        $data['instansi'] = Instansi::all();
        $data['dataset'] = Dataset::orderBy('DatasetId','DESC')->limit(5)->get();
        return view('search',$data);
    }
}
