MessageAreaController.php 2.09 KB
<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Models\ModelMailFeedback;
use Illuminate\Http\Request;

class MessageAreaController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $messages = ModelMailFeedback::query()->orderByDesc('created_at')->orderByDesc('id')->paginate(20);
        return view('admin.messages.index', compact('messages'));

    }

    /**
     * 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\Models\ModelMailFeedback  $message
     * @return \Illuminate\Http\Response
     */
    public function show(ModelMailFeedback $message)
    {
        return view('admin.messages.view', compact('message'));
    }

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

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

    /**
     * Remove the specified resource from storage.
     *
     * @param  \App\Models\ModelMailFeedback  $message
     * @return \Illuminate\Http\Response
     */
    public function destroy(ModelMailFeedback $message)
    {
        $message->delete();
        return redirect()->route('admin.message.index');
    }
}