Perubahan yang dilakukan: **Controller MemoController:** - Menambahkan MemoController untuk mengelola memo penyelesaian permohonan. - Method index() untuk menampilkan daftar permohonan yang bisa dipilih. - Method create() untuk form pembuatan memo dengan pemilihan data bulk. - Method store() untuk menyimpan memo dan mengupdate status permohonan terkait. - Method show() untuk menampilkan detail memo yang telah dibuat. - Method dataForDatatables() untuk API datatables dengan filter, search, dan pagination. - Implementasi DB transaction untuk menjaga integritas data. - Logging dan error handling komprehensif di setiap method. **View Template:** - index.blade.php: Tabel data permohonan dengan fitur checkbox selection (bulk). - create.blade.php: Form pembuatan memo dari data yang dipilih. - show.blade.php: Halaman detail memo penyelesaian. - Menggunakan Bootstrap untuk styling dan interaksi dinamis dengan JavaScript. - Validasi client-side untuk memastikan data sesuai sebelum dikirim. **Routing dan Navigasi:** - Menambahkan route resource untuk operasi CRUD Memo. - Menambahkan route khusus untuk datatables API dan bulk create. - Integrasi menu "Memo Penyelesaian" di navigasi utama aplikasi. - Role-based access control untuk keamanan akses fitur. **Integrasi Data:** - Menggunakan model Permohonan sebagai sumber data utama dengan eager loading. - Relasi dengan tabel user, debitur, branch, dan tujuan penilaian. - Menambahkan status management untuk mempermudah tracking progress permohonan. **Keamanan dan Validasi:** - Validasi input baik di sisi controller maupun client-side. - CSRF protection dan XSS prevention untuk menjaga keamanan aplikasi. - Permission checking sesuai level user. **Performance dan UX:** - Pagination dan query optimization untuk performa lebih baik. - Caching strategi untuk data yang sering diakses. - Interface yang intuitif, dengan loading state dan feedback message. - Responsive design untuk desktop dan mobile. - Shortcut keyboard untuk efisiensi power user. **Teknis dan Testing:** - Struktur kode mengikuti Laravel best practice dan design pattern. - Siap untuk unit test dan integration test. - Logging lengkap untuk monitoring dan debugging. - Error scenario handling dan fallback yang robust. Tujuan perubahan: - Menyediakan fitur pengelolaan memo penyelesaian permohonan secara bulk dengan user experience yang optimal dan performa efisien.
53 lines
1.5 KiB
PHP
53 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace Modules\Lpj\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
use Spatie\Activitylog\LogOptions;
|
|
use Spatie\Activitylog\Traits\LogsActivity;
|
|
use Mattiverse\Userstamps\Traits\Userstamps;
|
|
use Illuminate\Notifications\Notifiable;
|
|
|
|
|
|
/**
|
|
*
|
|
*/
|
|
class Base extends Model
|
|
{
|
|
use LogsActivity, SoftDeletes, Userstamps, Notifiable;
|
|
|
|
protected $connection;
|
|
|
|
/**
|
|
* Constructs a new instance of the class.
|
|
*
|
|
* @param array $attributes Optional attributes to initialize the object with.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct(array $attributes = [])
|
|
{
|
|
parent::__construct($attributes);
|
|
|
|
// Retrieve the module configuration from the module.json file
|
|
$modulePath = dirname(__FILE__, 3) . '/module.json';
|
|
$module = file_get_contents($modulePath);
|
|
$module = json_decode($module);
|
|
|
|
// Set the connection property to the database connection specified in the module configuration
|
|
$this->connection = $module->database;
|
|
}
|
|
|
|
/**
|
|
* Retrieves the activity log options for the User Management.
|
|
*
|
|
* @return LogOptions The activity log options.
|
|
*/
|
|
public function getActivitylogOptions()
|
|
: LogOptions
|
|
{
|
|
return LogOptions::defaults()->logAll()->useLogName('LPJ : ');
|
|
}
|
|
}
|