BaseModel::delete
Usage
void BaseModel::delete()Description
Delete a single model instance from the database table.Examples
Delete Product ID# 63
use App\Demo\Models\Product;
// Get product
$id = 63;
if (!$product = Product::whereId($id)) {
die("Product does not exist, id# $id");
}
// Delete product
$product->delete();