Isswp101\Persimmon\Model::destroy PHP Method

destroy() public static method

Destroy the models by the given id.
public static destroy ( mixed $id )
$id mixed
    public static function destroy($id)
    {
        $ids = is_array($id) ? $id : [$id];
        foreach ($ids as $id) {
            $model = static::find($id);
            if (!is_null($model)) {
                $model->delete();
            }
        }
    }