feat(webstatement): tambah fitur manajemen Jenis Kartu
- Menambahkan model, migrasi, seed, controller, request, dan tampilan untuk fitur Jenis Kartu. - Menambahkan routing dan breadcrumbs untuk Jenis Kartu. - Mengimplementasikan fungsi CRUD, ekspor data ke Excel, dan penghapusan multiple records pada Jenis Kartu. - Memperbarui `module.json` untuk menampilkan menu Jenis Kartu di bagian Master. - Menambah seeder untuk data awal Jenis Kartu. Signed-off-by: Daeng Deni Mardaeni <ddeni05@gmail.com>
This commit is contained in:
51
app/Models/Base.php
Normal file
51
app/Models/Base.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Webstatement\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Spatie\Activitylog\LogOptions;
|
||||
use Spatie\Activitylog\Traits\LogsActivity;
|
||||
use Wildside\Userstamps\Userstamps;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Base extends Model
|
||||
{
|
||||
use LogsActivity, SoftDeletes, Userstamps;
|
||||
|
||||
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('User Management : ');
|
||||
}
|
||||
}
|
||||
22
app/Models/JenisKartu.php
Normal file
22
app/Models/JenisKartu.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Webstatement\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\Webstatement\Database\Factories\JenisKartuFactory;
|
||||
|
||||
class JenisKartu extends Base
|
||||
{
|
||||
protected $table = "jenis_kartu";
|
||||
protected $fillable = [
|
||||
'code',
|
||||
'name',
|
||||
'biaya',
|
||||
'authorized_status',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
'authorized_by',
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user