disable penyata uncomplete

This commit is contained in:
hayatie
2025-12-10 12:01:04 +08:00
parent 90177859aa
commit d62e5f6105
3 changed files with 48 additions and 1 deletions
@@ -0,0 +1,31 @@
<?php
namespace App\Http\Controllers;
use App\Models\Penyata;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class PenyataController extends Controller
{
// Get penyata by id
public function show($id)
{
$penyata = penyata::select(
'saham',
'yuran',
'pelaburan_t1 AS pelaburanT1',
'pelaburan_t2 AS pelaburanT2',
'pinjaman_aqh AS pinjamanAQH',
'pinjaman_bba AS pinjamanBBA',
'pinjaman_bai AS pinjamanBAI',
'pinjaman_bys AS pinjamanBYS',
'insurans_cukai',
'pinj_pelbagai AS pinjamanPelbagai'
)->find($id);
return response()->json($penyata);
}
}
+12
View File
@@ -0,0 +1,12 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Penyata extends Model
{
protected $table = 'penyata'; // optional if table name matches model
protected $primaryKey = 'id'; // optional if primary key is 'id'
public $timestamps = false; // set to true if table has created_at/updated_at
}
+5 -1
View File
@@ -4,6 +4,7 @@ use App\Http\Controllers\MayaController;
use App\Http\Controllers\FizikalController;
use App\Http\Controllers\KehadiranController;
use App\Http\Controllers\ResultController;
use App\Http\Controllers\PenyataController;
use App\Result;
use Illuminate\Support\Facades\Route;
use Barryvdh\DomPDF\PDF;
@@ -11,6 +12,7 @@ use Illuminate\Support\Facades\App;
/*
|--------------------------------------------------------------------------
| Web Routes
@@ -41,5 +43,7 @@ Route::get('/fizikalpdf/{id}', [FizikalController::class, 'index']);
Route::get('/mayapdf/{id}', [MayaController::class, 'index']);
Route::view('/{any}', 'index')->where('any', '.*');
Route::get('/penyata/{id}', [App\Http\Controllers\PenyataController::class, 'show']);