74 lines
1.9 KiB
PHP
74 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace Modules\User\Http\Controllers;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Contracts\Support\Renderable;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Collection;
|
|
use Illuminate\Support\Facades\Validator;
|
|
use Illuminate\Support\Facades\Storage;
|
|
use Illuminate\Support\Str;
|
|
|
|
use App\Models\{Content, Galeri, User};
|
|
|
|
use DataTables;
|
|
use GuzzleHttp\Client;
|
|
use Carbon\Carbon;
|
|
|
|
class ContentController extends Controller
|
|
{
|
|
public function papan_informasi()
|
|
{
|
|
$data = [
|
|
'subtitle' => 'Papan Informasi',
|
|
];
|
|
|
|
$informasi = Content::where('status', 1)->orderBy('created_at', 'desc')->paginate(12);
|
|
return view('user::content.papan_informasi', compact('informasi', 'data'));
|
|
}
|
|
|
|
public function detail_informasi($id)
|
|
{
|
|
$detail = Content::where('slug', $id)->first();
|
|
if($detail) {
|
|
$data = [
|
|
'subtitle' => $detail->title
|
|
];
|
|
|
|
return view('user::content.detail_informasi', compact('detail', 'data'));
|
|
} else {
|
|
return redirect()->back()->with('error', 'Informasi tidak ditemukan');
|
|
}
|
|
}
|
|
|
|
public function galeri()
|
|
{
|
|
$data = [
|
|
'subtitle' => 'Galeri',
|
|
];
|
|
|
|
$galeri = Galeri::where('status', 1)->orderBy('created_at', 'desc')->paginate(12);
|
|
return view('user::content.galeri', compact('galeri', 'data'));
|
|
}
|
|
|
|
public function profil_sekolah()
|
|
{
|
|
$data = [
|
|
'subtitle' => 'Profil Sekolah',
|
|
];
|
|
|
|
return view('user::content.profil', compact('data'));
|
|
}
|
|
|
|
public function guru()
|
|
{
|
|
$data = [
|
|
'subtitle' => 'Daftar Tenaga Pendidik',
|
|
];
|
|
|
|
$guru = User::where('level', 3)->where('status', 1)->orderBy('created_at', 'desc')->paginate(12);
|
|
return view('user::content.guru', compact('data', 'guru'));
|
|
}
|
|
}
|