<?php namespace App\Http\Controllers;

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

use App\Models\Log;
use App\Repositories\LogRepository;
use Illuminate\Http\Request;

class LogsController extends Controller {

    private $logRepository;
	/**
	 * Display a listing of the resource.
	 *
	 * @return Response
	 */

    public function __construct(LogRepository $logRepository){
        $this->logRepository=$logRepository;
    }


	public function index()
	{
		$logs=Log::with('employee','guardian')->get();
       // dd($logs->find(1));
        return view('logs.index' , compact('logs'));
	}

	/**
	 * Show the form for creating a new resource.
	 *
	 * @return Response
	 */
	public function create()
	{
        return redirect(route('log.index'));
	}

	/**
	 * Store a newly created resource in storage.
	 *
	 * @return Response
	 */
	public function store()
	{
        return redirect(route('log.index'));
	}

	/**
	 * Display the specified resource.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function show($id)
	{
        $log=Log::with('employee','guardian')->find($id);
        return view('logs.show' , compact('log'));
	}

	/**
	 * Show the form for editing the specified resource.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function edit($id)
	{
        return redirect(route('log.index'));
	}

	/**
	 * Update the specified resource in storage.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function update($id)
	{
        return redirect(route('log.index'));
	}

	/**
	 * Remove the specified resource from storage.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function destroy($id)
	{
        $this->logRepository->delete($id);
        return redirect(route('log.index'));
	}

}
