Git Product home page Git Product logo

laravel-computed-properties's People

Contributors

ankurk91 avatar n7olkachev avatar tabuna 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  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  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  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  avatar  avatar  avatar

laravel-computed-properties's Issues

Benefit of this package vs simple cacher

How is this package any better than just doing something like the below:

public function getSumAttribute()
{    
    return $this->rememberAs('sum', function() {
        OrderProduct::select(new Expression('sum(price * count)'))
            ->where('order_id', $this->id);
    });
}

If you have a basic implementation of rememberAs on your model which sees if the key already exists and if not, run the closure and set the value on the model.

This isn't 'real' computed properites

I assume the computed name has come from the world of Vue.

Computed properties in Vue react to data that changes on the model, so if you were to update anything in which the computed property used, it will re-compute the computed property.

This is more of a 'watch out' type warning to people thinking it's 'real' computed properties (as they know it) from Vue.

Laravel 5.6 still not working

composer require n7olkachev/laravel-computed-properties

Using version ^1.1 for n7olkachev/laravel-computed-properties
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- Conclusion: remove laravel/framework v5.6.26
- Conclusion: don't install laravel/framework v5.6.26
- n7olkachev/laravel-computed-properties v1.1.0 requires illuminate/config ~5.4.0 -> satisfiable by illuminate/config[v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.27, v5.4.36, v5.4.9].
- n7olkachev/laravel-computed-properties v1.1.1 requires illuminate/config ~5.4.0|~5.5.0 -> satisfiable by illuminate/config[v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.27, v5.4.36, v5.4.9, v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34, v5.5.35, v
5.5.36, v5.5.37, v5.5.39, v5.5.40].
- don't install illuminate/config v5.4.0|don't install laravel/framework v5.6.26
- don't install illuminate/config v5.4.13|don't install laravel/framework v5.6.26
- don't install illuminate/config v5.4.17|don't install laravel/framework v5.6.26
- don't install illuminate/config v5.4.19|don't install laravel/framework v5.6.26
- don't install illuminate/config v5.4.27|don't install laravel/framework v5.6.26
- don't install illuminate/config v5.4.36|don't install laravel/framework v5.6.26
- don't install illuminate/config v5.4.9|don't install laravel/framework v5.6.26
- don't install illuminate/config v5.5.0|don't install laravel/framework v5.6.26
- don't install illuminate/config v5.5.16|don't install laravel/framework v5.6.26
- don't install illuminate/config v5.5.17|don't install laravel/framework v5.6.26
- don't install illuminate/config v5.5.2|don't install laravel/framework v5.6.26
- don't install illuminate/config v5.5.28|don't install laravel/framework v5.6.26
- don't install illuminate/config v5.5.33|don't install laravel/framework v5.6.26
- don't install illuminate/config v5.5.34|don't install laravel/framework v5.6.26
- don't install illuminate/config v5.5.35|don't install laravel/framework v5.6.26
- don't install illuminate/config v5.5.36|don't install laravel/framework v5.6.26
- don't install illuminate/config v5.5.37|don't install laravel/framework v5.6.26
- don't install illuminate/config v5.5.39|don't install laravel/framework v5.6.26
- don't install illuminate/config v5.5.40|don't install laravel/framework v5.6.26
- Installation request for laravel/framework (locked at v5.6.26, required as 5.6.*) -> satisfiable by laravel/framework[v5.6.26].
- Installation request for n7olkachev/laravel-computed-properties ^1.1 -> satisfiable by n7olkachev/laravel-computed-properties[v1.1.0, v1.1.1].

Installation failed, reverting ./composer.json to its original content.

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.