first commit
This commit is contained in:
52
app/Http/Controllers/Admin/ManageContactController.php
Normal file
52
app/Http/Controllers/Admin/ManageContactController.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Admin\ManageContactService;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\ContactUs;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use App\Exports\UsersExport;
|
||||
|
||||
class ManageContactController extends Controller {
|
||||
|
||||
public function __construct(ManageContactService $manageContactService) {
|
||||
$this->manageContactService = $manageContactService;
|
||||
}
|
||||
|
||||
public function create() {
|
||||
return view('Admin.Pages.manage_contact.manage_contact');
|
||||
}
|
||||
|
||||
public function view_contact(Request $req) {
|
||||
$manage_contact = $this->manageContactService->view_contact();
|
||||
return view('Admin.Pages.manage_contact.manage_contact')->with(['manage_contact' => $manage_contact]);
|
||||
}
|
||||
|
||||
public function deleted(Request $request) {
|
||||
$deleted_contact = $this->manageContactService->delete_contact();
|
||||
return view('Admin.Pages.manage_contact.manage_contact_deleted')->with(['deleted_contact' => $deleted_contact]);
|
||||
}
|
||||
|
||||
public function delete_contact($id) {
|
||||
ContactUs::find($id)->delete();
|
||||
}
|
||||
|
||||
public function sendManageContact(Request $request) {
|
||||
|
||||
$contact = $this->manageContactService->send_mail($request);
|
||||
return response()->json([
|
||||
'status' => 200
|
||||
]);
|
||||
}
|
||||
|
||||
public function exportUser()
|
||||
{
|
||||
// return Excel::download(new UsersExport, 'users.xlsx');
|
||||
// return Excel::download(new UsersExport, 'user.xlsx', \Maatwebsite\Excel\Excel::XLSX);
|
||||
// return Excel::download(new UsersExport, 'user.xlsx');
|
||||
return Excel::download(new UsersExport, 'user.xlsx');
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user