# Deleting Resources

You can allow resources to be deleted (opens new window) using the deletable and notDeletable methods on the schema builder.

Optionally pass a closure that returns a boolean value.

$type->deletable();

$type->deletable(function (Context $context) {
    return $context->getRequest()->getAttribute('user')->isAdmin();
});

# Events

# onDeleting

Run before the model is deleted.

$type->onDeleting(function (&$model, Context $context) {
    // do something
});

# onDeleted

Run after the model is deleted.

$type->onDeleted(function (&$model, Context $context) {
    // do something
});