Kode dari ftuntan_main dengan dependensi diperbarui untuk PHP 8.3 (perbaikan insiden 27 Okt 2026). Dump database di database/sql/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
65 lines
1.6 KiB
PHP
65 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\Kontak;
|
|
use App\Models\LinkProdi;
|
|
use App\Models\ProfilSingkat;
|
|
use App\Models\AplikasiIntegrasi;
|
|
use App\Models\InformasiTerbaru;
|
|
use App\Models\HimpunanMahasiswa;
|
|
use App\Models\Pertanyaan;
|
|
use App\Models\Prodi;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Validator;
|
|
|
|
class PertanyaanController extends Controller
|
|
{
|
|
/**
|
|
* Display a listing of the resource.
|
|
*
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function index()
|
|
{
|
|
$session_user = Auth::user();
|
|
$pertanyaans = Pertanyaan::withTrashed()->get()
|
|
->sortDesc();
|
|
return view('admin.pertanyaan.index', compact('pertanyaans', 'session_user'));
|
|
}
|
|
|
|
/**
|
|
* Remove the specified resource from storage.
|
|
*
|
|
* @param \App\Models\Pertanyaan $pertanyaan
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function destroy(Pertanyaan $pertanyaan)
|
|
{
|
|
Pertanyaan::destroy($pertanyaan->id);
|
|
|
|
return redirect('/admin/pertanyaan')->with('status', 'Pertanyaan Berhasil Dihapus');
|
|
}
|
|
|
|
public function restore($id)
|
|
{
|
|
$pertanyaan = Pertanyaan::withTrashed()
|
|
->where('id', $id)
|
|
->first();
|
|
|
|
$pertanyaan->restore();
|
|
return redirect('/admin/pertanyaan')->with('status', 'Pertanyaan Berhasil Direstore');
|
|
}
|
|
|
|
public function delete($id)
|
|
{
|
|
$pertanyaan = Pertanyaan::withTrashed()
|
|
->where('id', $id)
|
|
->first();
|
|
|
|
$pertanyaan->forceDelete();
|
|
return redirect('/admin/pertanyaan')->with('status', 'Pertanyaan Berhasil Dihapus Permanen');
|
|
}
|
|
}
|