<?php

namespace App\Http\Controllers;

use App\Cron;
use Illuminate\Http\Request;

class CronController extends Controller
{
    function __construct()
    {
         $this->middleware('permission:cron-list|cron-create|cron-edit|cron-delete', ['only' => ['index','store']]);
         $this->middleware('permission:cron-create', ['only' => ['create','store']]);
         $this->middleware('permission:cron-edit', ['only' => ['edit','update']]);
         $this->middleware('permission:cron-delete', ['only' => ['destroy']]);
    }
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $data = Cron::orderBy('id','DESC')->get();
        return view('cron.index',compact('data'));
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        //
    }

    /**
     * Display the specified resource.
     *
     * @param  \App\Cron  $cron
     * @return \Illuminate\Http\Response
     */
    public function show(Cron $cron)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  \App\Cron  $cron
     * @return \Illuminate\Http\Response
     */
    public function edit(Cron $cron)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Cron  $cron
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, Cron $cron)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  \App\Cron  $cron
     * @return \Illuminate\Http\Response
     */
    public function destroy(Cron $cron)
    {
        //
    }
}
