Files
webstatement/app/Models/Base.php
Daeng Deni Mardaeni 47bf23302f refactor(webstatement): ganti namespace trait Userstamps untuk kompatibilitas
- Mengganti pemanggilan trait `Userstamps` dari `Wildside\Userstamps\Userstamps` menjadi `Mattiverse\Userstamps\Traits\Userstamps`:
  - Update dilakukan pada file `Modules/Webstatement/app/Models/Base.php`.
  - Perubahan ini memastikan penggunaan namespace yang sesuai dan kompatibel dengan library yang terbaru.

Signed-off-by: Daeng Deni Mardaeni <ddeni05@gmail.com>
2025-06-05 16:50:18 +07:00

52 lines
1.5 KiB
PHP

<?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 Mattiverse\Userstamps\Traits\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 : ');
}
}