2323The Basic Usage of this package is the same of getting count of some model instances, but with a styled response
2424
2525``` php
26- $instance = (new \SOS\RelationalMetrics\Classes\RelationalMetrics(ModelName));
27- // EX: new RelationalMetrics( Store);
26+ $instance = (new \SOS\RelationalMetrics\Classes\RelationalMetrics(" ModelName" ));
27+ // example: ( new \SOS\ RelationalMetrics\Classes\RelationalMetrics(" Store") );
2828 $metrics = $instance->getBasicMetrics();
2929 /*
3030 * Response will be like:
@@ -40,10 +40,10 @@ What you can do next, you could get the metrics of a model depending on one of i
4040Let's assume we want to get the number of stores that has products with price more than 500
4141
4242``` php
43- $instance = (new \SOS\RelationalMetrics\Classes\RelationalMetrics(ModelName));
44- // EX: new RelationalMetrics( Store);
43+ $instance = (new \SOS\RelationalMetrics\Classes\RelationalMetrics(" ModelName" ));
44+ // example: ( new \SOS\ RelationalMetrics\Classes\RelationalMetrics(" Store") );
4545 $metrics = $instance->getRelationalMetrics($relationName, $relationColumn, $value);
46- // EX : $instance->getRelationalMetrics('products, 'price', 500);
46+ // example : $instance->getRelationalMetrics('products, 'price', 500);
4747 /*
4848 * Response will be like:
4949 * [
@@ -60,15 +60,16 @@ And last but not least, You could get the metrics about a model depending on any
6060
6161
6262``` php
63- $instance = (new \SOS\RelationalMetrics\Classes\RelationalMetrics(ModelName));
64- // EX: new RelationalMetrics(Store);
63+ $instance = (new \SOS\RelationalMetrics\Classes\RelationalMetrics("ModelName"));
64+ // example: (new \SOS\RelationalMetrics\Classes\RelationalMetrics("Store"));
65+
66+ // example for the conditions
67+ $conditions = [
68+ ['method' => 'where', 'column' => 'address', 'operator' => 'like', 'value' => '%UAE%'],
69+ ['method' => 'where', 'column' => 'rate', 'operator' => '>', 'value' => 3],
70+ ];
6571 $metrics = $instance->getRelationalMetrics($conditions);
66- // EX: $instance->getRelationalMetrics(
67- [
68- ['method' => 'where', 'column' => 'address', 'operator' => 'like', 'value' => '%UAE%'],
69- ['method' => 'where', 'column' => 'rate', 'operator' => '>', 'value' => 3],
70- ]
71- );
72+
7273 /*
7374 * Response will be like:
7475 * [
@@ -88,11 +89,11 @@ Please see the [CHANGELOG](https://github.com/syrian-open-source/laravel-relatio
8889
8990Security
9091--------
91- If you discover any security related issues, please email them first to " zainaldeenfayod@gmail.com " ,
92+ If you discover any security related issues, please email them first to zainaldeenfayod@gmail.com ,
9293if we do not fix it within a short period of time please open a new issue describing your problem.
9394
9495Credits
9596-------
96- * [ zainaldeenfayod@gmail.com ] ( https://github. com/zainaldeen/laravel-relational-metrics-1 )
97+ * [ Zain Aldeen Fayod ] ( https://www.linkedin. com/in/zainaldeenfayod/ )
9798* [ All contributors] ( https://github.com/syrian-open-source/laravel-relational-metrics/graphs/contributors )
9899
0 commit comments