BaseModel::toArray
Usage
array BaseModel::toArray()Description
Get all properties of the model instance returned in an array.Return Value
Returns an associative array consisting of all properties within the model instance.Examples
Get Product Array
use App\Demo\Models\Product;
// Get product
$id = 32;
if (!$product = Product::whereId($id)) {
die("No product exists with id# $id");
}
// Get product as array
$vars = $product->toArray();
print_r($vars);