phpvms/app/Models/Observers/SettingObserver.php
2018-03-19 20:50:40 -05:00

23 lines
366 B
PHP

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