HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: /home/mmickelson/spilicensing/app/Http/Controllers/ActivityTypeController.php
<?php

namespace App\Http\Controllers;

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

use App\ActivityType;
use Illuminate\Http\Request;
use Carbon\Carbon;
use Session;

class ActivityTypeController extends Controller
{
    public function __construct()
    {
        $this->middleware('auth');
    }
    
    /**
     * Display a listing of the resource.
     *
     * @return Response
     */
    public function index()
    {
        $activitytype = ActivityType::paginate(15);

        return view('activitytype.index', compact('activitytype'));
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return Response
     */
    public function create()
    {
        return view('activitytype.create');
    }

    /**
     * Store a newly created resource in storage.
     *
     * @return Response
     */
    public function store(Request $request)
    {
        
        ActivityType::create($request->all());

        Session::flash('flash_message', 'ActivityType added!');

        return redirect('activitytype');
    }

    /**
     * Display the specified resource.
     *
     * @param  int  $id
     *
     * @return Response
     */
    public function show($id)
    {
        $activitytype = ActivityType::findOrFail($id);

        return view('activitytype.show', compact('activitytype'));
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  int  $id
     *
     * @return Response
     */
    public function edit($id)
    {
        $activitytype = ActivityType::findOrFail($id);

        return view('activitytype.edit', compact('activitytype'));
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  int  $id
     *
     * @return Response
     */
    public function update($id, Request $request)
    {
        
        $activitytype = ActivityType::findOrFail($id);
        $activitytype->update($request->all());

        Session::flash('flash_message', 'ActivityType updated!');

        return redirect('activitytype');
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  int  $id
     *
     * @return Response
     */
    public function destroy($id)
    {
        ActivityType::destroy($id);

        Session::flash('flash_message', 'ActivityType deleted!');

        return redirect('activitytype');
    }

}