progress model
This commit is contained in:
parent
38a35142be
commit
c647e3cfe1
17
app/Http/Controllers/SoalController.php
Normal file
17
app/Http/Controllers/SoalController.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Soal;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class SoalController extends Controller
|
||||
{
|
||||
public function index(){
|
||||
$soal = Soal::first();
|
||||
$payload = [
|
||||
'soal' => $soal
|
||||
];
|
||||
return view('soal.index', $payload);
|
||||
}
|
||||
}
|
||||
17
app/Models/Jawaban.php
Normal file
17
app/Models/Jawaban.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Jawaban extends Model
|
||||
{
|
||||
protected $connection = 'dbLmsMutu';
|
||||
protected $table = 'public.lms_mutu_jawaban';
|
||||
protected $guarded = ['id'];
|
||||
protected $with = ['jawabanDetail'];
|
||||
|
||||
public function jawabanDetail(){
|
||||
return $this->hasMany(JawabanDetail::class, 'lms_mutu_jawaban_id', 'id');
|
||||
}
|
||||
}
|
||||
12
app/Models/JawabanDetail.php
Normal file
12
app/Models/JawabanDetail.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class JawabanDetail extends Model
|
||||
{
|
||||
protected $connection = 'dbLmsMutu';
|
||||
protected $table = 'public.lms_mutu_jawaban_detail';
|
||||
protected $guarded = ['id'];
|
||||
}
|
||||
17
app/Models/Soal.php
Normal file
17
app/Models/Soal.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Soal extends Model
|
||||
{
|
||||
protected $connection = 'dbLmsMutu';
|
||||
protected $table = 'public.lms_mutu_soal';
|
||||
protected $guarded = ['id'];
|
||||
protected $with = ['soalDetail'];
|
||||
|
||||
public function soalDetail(){
|
||||
return $this->hasMany(SoalDetail::class, 'lms_mutu_soal_id', 'id');
|
||||
}
|
||||
}
|
||||
12
app/Models/SoalDetail.php
Normal file
12
app/Models/SoalDetail.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SoalDetail extends Model
|
||||
{
|
||||
protected $connection = 'dbLmsMutu';
|
||||
protected $table = 'public.lms_mutu_soal_detail';
|
||||
protected $guarded = ['id'];
|
||||
}
|
||||
4
resources/views/soal/index.blade.php
Normal file
4
resources/views/soal/index.blade.php
Normal file
@ -0,0 +1,4 @@
|
||||
@extends('layouts.template')
|
||||
@section('content')
|
||||
|
||||
@endsection
|
||||
@ -1,10 +1,9 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\AuthController;
|
||||
use App\Http\Controllers\SoalController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
// Route::get('/login', [AuthController::class, 'login']);
|
||||
|
||||
Route::get('/', function () {
|
||||
return view('welcome');
|
||||
});
|
||||
Route::get('/', [SoalController::class, 'index']);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user