<?php

namespace App\Http\Controllers;

use App\Rental;
use Illuminate\Http\Request;

use App\Http\Requests;

class RentalController extends Controller
{

    /**
     * Get all the requested rentals.
     *
     * @param string $type, the database selector, where the data range will set on.
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function indexAdmin($type)
    {
        if ($type == 'all' || empty($type))
        {
            $data['rentals'] = Rental::paginate(15);
        } elseif($type == 'new') {
            $data['rentals'] = Rental::where('status', 0)->paginate(15);
        } elseif($type == 'option') {
            $data['rentals'] = Rental::where('status', 1)->paginate(15);
        }

        return view('backend.rental.overview', $data);
    }

    /**
     * Insert view for a backend rental insert.
     *
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function insert()
    {
        return view('backend.rental.insert');
    }

    /**
     * Insert a new rental.
     *
     * @param Requests\RentalValidator $input
     * @return \Illuminate\Http\RedirectResponse
     */
    public function store(Requests\RentalValidator $input)
    {
        Rental::insert($input->except('_token'));
        session()->flash('message', 'Nieuwe verhuring toegevoegd');

        return redirect()->back(302);
    }

    /**
     * Delete a rental.
     *
     * @param  int, $id, the rental id in the database.
     * @return \Illuminate\Http\RedirectResponse
     */
    public function destroy($id)
    {
        Rental::destroy($id);
        session()->flash('message', 'U hebt een verhuring verwijderd');

        return redirect()->back(302);
    }

    /**
     * Set a rental to confirmed.
     *
     * @param  int, $id, the rental id in the database.
     * @return \Illuminate\Http\RedirectResponse
     */
    public function confirmed($id)
    {
        $rental = Rental::find($id);
        $rental->Status = 2;
        $rental->save();

        session()->flash('message', 'U hebt een verhuring de status bevestgd gegeven.');

        return redirect()->back(302);
    }

    /**
     * Set a rental to option status.
     *
     * @param int, $id, The rental id in the database.
     * @return \Illuminate\Http\RedirectResponse
     */
    public function option($id)
    {
        $rental = Rental::find($id);
        $rental->Status = 1;
        $rental->save();

        session()->flash('message', 'U hebt een verhuring de status optie gegeven');

        return redirect()->back(302);
    }
}

Add the rental controller - backend
Add the rental controller - backend
