<?php

namespace Alum\Alum\Http\Controllers;

use App\Http\Controllers\PublicController as CMSPublicController;
use Alum\Alum\Interfaces\WebAlumnusRepositoryInterface;

class WebAlumnusPublicController extends CMSPublicController
{
    /**
     * Constructor.
     *
     * @param type \Alum\WebAlumnus\Interfaces\WebAlumnusRepositoryInterface $web_alumnus
     *
     * @return type
     */
    public function __construct(WebAlumnusRepositoryInterface $web_alumnus)
    {
        $this->model = $web_alumnus;
        parent::__construct();
    }

    /**
     * Show web_alumnus's list.
     *
     * @param string $slug
     *
     * @return response
     */
    protected function index()
    {
        $web_alumni = $this->model->all();

        return $this->theme->of('alum::public.web_alumnus.index', compact('web_alumni'))->render();
    }

    /**
     * Show web_alumnus.
     *
     * @param string $slug
     *
     * @return response
     */
    protected function show($slug)
    {
        $web_alumnus = $this->model->findBySlug($slug);

        return $this->theme->of('alum::public.web_alumnus.show', compact('web_alumnus'))->render();
    }
}