<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
syrian-open-source / laravel-relational-metrics example snippets
// first you must make a model from facade class
// like post model
$instance = \SOS\RelationalMetrics\Facades\RelationalMetricsFacade::setModel("Post");
// or you can specify thr model name by this way: RelationalMetricsFacade::setModel(Store::class);
$metrics = $instance->getBasicMetrics();
// or you can get the count or the message directly.
$directCount = $instance->getCount();
$directName = $instance->getName();
/*
* Response will be like:
* [
* 'name' => 'Total Stores Number,
* 'count' => 43,
* ];
*
*/