File: /home/mmickelson/spilicensing/app/Http/Controllers/LicenseTypeController.php
<?php
namespace App\Http\Controllers;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\LicenseType;
use Illuminate\Http\Request;
use Carbon\Carbon;
use Session;
class LicenseTypeController extends Controller
{
public function __construct()
{
$this->middleware('auth');
}
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$licensetype = LicenseType::paginate(15);
return view('licensetype.index', compact('licensetype'));
}
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
return view('licensetype.create');
}
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store(Request $request)
{
LicenseType::create($request->all());
Session::flash('flash_message', 'LicenseType added!');
return redirect('licensetype');
}
/**
* Display the specified resource.
*
* @param int $id
*
* @return Response
*/
public function show($id)
{
$licensetype = LicenseType::findOrFail($id);
return view('licensetype.show', compact('licensetype'));
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
*
* @return Response
*/
public function edit($id)
{
$licensetype = LicenseType::findOrFail($id);
return view('licensetype.edit', compact('licensetype'));
}
/**
* Update the specified resource in storage.
*
* @param int $id
*
* @return Response
*/
public function update($id, Request $request)
{
$licensetype = LicenseType::findOrFail($id);
$licensetype->update($request->all());
Session::flash('flash_message', 'LicenseType updated!');
return redirect('licensetype');
}
/**
* Remove the specified resource from storage.
*
* @param int $id
*
* @return Response
*/
public function destroy($id)
{
LicenseType::destroy($id);
Session::flash('flash_message', 'LicenseType deleted!');
return redirect('licensetype');
}
}