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>
73 lines
2.2 KiB
PHP
73 lines
2.2 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\HimpunanMahasiswa;
|
|
use App\Models\InformasiTerbaru;
|
|
use App\Models\RuangLab;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Validator;
|
|
|
|
class RuangLabController extends Controller
|
|
{
|
|
/**
|
|
* Display a listing of the resource.
|
|
*
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function index()
|
|
{
|
|
$session_user = Auth::user();
|
|
$ruangLab = RuangLab::all()->first();
|
|
return view('admin.ruang_lab.index', compact('ruangLab', 'session_user'));
|
|
}
|
|
|
|
/**
|
|
* Update the specified resource in storage.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @param \App\Models\RuangLab $ruangLab
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function update(Request $request, RuangLab $ruangLab)
|
|
{
|
|
$this->validate($request, [
|
|
'teks' => 'required'
|
|
]);
|
|
|
|
RuangLab::where('id', $ruangLab->id)
|
|
->update([
|
|
'teks' => $request->teks
|
|
]);
|
|
|
|
return redirect('admin/ruang_lab')->with('status', 'Ruang Lab Berhasil Diubah!');
|
|
}
|
|
|
|
public function menuRuangLab()
|
|
{
|
|
$kontak = Kontak::all()->first();
|
|
$himpunanMahasiswaHeaders = HimpunanMahasiswa::where('release_date', '<=', date('Y-m-d'))
|
|
->orderBy('release_date', 'DESC')
|
|
->get();
|
|
|
|
$linkProdis = LinkProdi::where('release_date', '<=', date('Y-m-d'))
|
|
->orderBy('release_date', 'DESC')
|
|
->get();
|
|
$profilSingkat = ProfilSingkat::all()->first();
|
|
$ruangLab = RuangLab::all()->first();
|
|
|
|
$informasiTerbarus = InformasiTerbaru::informasiTerbaru()->take(6)->get();
|
|
$aplikasiIntegrasis = AplikasiIntegrasi::where('release_date', '<=', date('Y-m-d'))
|
|
->orderBy('release_date', 'DESC')
|
|
->take(3)
|
|
->get();
|
|
|
|
return view('portal.ruang_lab.index', compact('ruangLab', 'himpunanMahasiswaHeaders', 'linkProdis', 'profilSingkat', 'kontak', 'informasiTerbarus', 'aplikasiIntegrasis'));
|
|
}
|
|
}
|