Giter Site home page Giter Site logo

syrian-open-source / laravel-relational-metrics Goto Github PK

View Code? Open in Web Editor NEW
25.0 25.0 2.0 145 KB

This package will help you to make your metrics easier, You could get metrics about your Models, Models depending on their relations, or even metrics about your models depending on multiple conditions!!

PHP 100.00%
laravel laravel-package metrics syria syrian-open-source

laravel-relational-metrics's People

Contributors

foobar2016 avatar karam-mustafa avatar roduankd avatar zainaldeen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

laravel-relational-metrics's Issues

Class response best practice

RelationalMetrics shoud return the values by getters also

example:
insead of get the count in this way

    $count = $instance->getBasicMetrics()['count'];

we should able to get the count from a getter function like getCount();

   $count =  $instance->getBasicMetrics()->getCount();

this will make the class more cohesion

Get the results by trait in model

I think we can handle the logic for a custom model by adding trait in the model.

example:
instead of using the package in the follwing way

 $instance = (new \SOS\RelationalMetrics\Classes\RelationalMetrics("Store")); 
 $metrics = $instance->getBasicMetrics();

we can get the same result as this example:

$metrics = Store::getBasicMetrics();

and the getBasicMetrics function should be able to call statically or from a new instance of the model

Using facades

The package depending should be called from facades classes, In order to hide the complexity of dependencies

example:
instead of using the direct classes

    $instance =   (new \SOS\RelationalMetrics\Classes\RelationalMetrics("ModelName"));

we can use it from the facade class

    $instance =   (new \SOS\RelationalMetrics\Classes\RelationalMetricsFacade())->setModel("ModelName")
                         ->getRelationalMetrics()
                         ->getCount();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.