phpvms/app/Models/Observers/SettingObserver.php
2018-08-26 16:40:04 +00:00

22 lines
333 B
PHP

<?php
namespace App\Models\Observers;
use App\Models\Setting;
/**
* Class SettingObserver
*/
class SettingObserver
{
/**
* @param Setting $model
*/
public function creating(Setting $model): void
{
if (!empty($model->id)) {
$model->id = Setting::formatKey($model->id);
}
}
}