Init
This commit is contained in:
31
app/Http/Controllers/Admin/ContactController.php
Normal file
31
app/Http/Controllers/Admin/ContactController.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Contact;
|
||||
|
||||
class ContactController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display Contact Page.
|
||||
*/
|
||||
public function index(): \Illuminate\View\View
|
||||
{
|
||||
$contacts = Contact::orderBy('created_at', 'DESC')->get();
|
||||
|
||||
return view('admin.contact.index', [
|
||||
'contacts' => $contacts
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Contact.
|
||||
*/
|
||||
public function delete(int $contact_id): \Illuminate\Http\RedirectResponse
|
||||
{
|
||||
Contact::where('id', $contact_id)->delete();
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user