for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace App\Modules\Core\ModelObservers;
/**
* Handling of model events,
*/
class SettingsObserver {
public function saving($model)
$model
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
{
//
}
public function saved($model)
* Prevent the creating of the settings.
*
* @param object $model the model beign created.
* @return void
public function creating($model)
$error = \ErrorHandler::cannotCreateSetting();
abort($error['status'], $error['message']);
public function created($model)
* Prevent updating of the setting key.
* @param object $model the model beign updated.
public function updating($model)
if ($model->original['key'] !== $model->key)
$error = \ErrorHandler::cannotUpdateSettingKey();
public function updated($model)
public function deleting($model)
public function deleted($model)
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.