eloquent-viewable | Associate views with Eloquent models in Laravel | Database library

 by   cyrildewit PHP Version: v7.0.1 License: MIT

kandi X-RAY | eloquent-viewable Summary

kandi X-RAY | eloquent-viewable Summary

eloquent-viewable is a PHP library typically used in Database, Laravel applications. eloquent-viewable has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

Sometimes you don't want to pull in a third-party service like Google Analytics to track your application's page views. Then this package comes in handy. Eloquent Viewable allows you to easiliy associate views with Eloquent models. It's designed with simplicity in mind. This package stores each view record individually in the database. The advantage of this is that it allows us to make very specific counts. For example, if we want to know how many people has viewed a specific post between January 10 and February 17 in 2018, we can do the following: views($post)->period(Period::create('10-01-2018', '17-02-2018'))->count();. The disadvantage of this is that your database can grow rapidly in size depending on the amount of visitors your application has.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              eloquent-viewable has a low active ecosystem.
              It has 695 star(s) with 95 fork(s). There are 17 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 3 open issues and 155 have been closed. On average issues are closed in 141 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of eloquent-viewable is v7.0.1

            kandi-Quality Quality

              eloquent-viewable has 0 bugs and 0 code smells.

            kandi-Security Security

              eloquent-viewable has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              eloquent-viewable code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              eloquent-viewable is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              eloquent-viewable releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              eloquent-viewable saves you 364 person hours of effort in developing the same functionality from scratch.
              It has 902 lines of code, 126 functions and 21 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed eloquent-viewable and discovered the below as its top functions. This is intended to give you an instant insight into eloquent-viewable implemented functionality, and help decide if they suit your requirements.
            • Register the service provider .
            • Bootstrap the application .
            • Scope with view count .
            • Query scope to include views within a given period .
            • Query scope for order by views count .
            • Listen to the deleted event .
            • Get the connection name .
            • Thrown when start date is not after end date .
            • Removes views on delete .
            • Get the facade accessor .
            Get all kandi verified functions for this library.

            eloquent-viewable Key Features

            No Key Features are available at this moment for eloquent-viewable.

            eloquent-viewable Examples and Code Snippets

            No Code Snippets are available at this moment for eloquent-viewable.

            Community Discussions

            QUESTION

            laravel + vue count number of views
            Asked 2021-May-09 at 02:56

            I have an articles site based on Laravel and Vue, I want to count the number of visits for each article (when the user opens the article the number of visits increases by one), in Laravel I used the eloquent-viewable package, but with Laravel + Vue I don't know how to do it.

            can you help me please

            ...

            ANSWER

            Answered 2021-May-09 at 02:56

            you can try this approach

            in your mount event register this function

            Source https://stackoverflow.com/questions/67445559

            QUESTION

            cyrildewit/eloquent-viewable package views
            Asked 2020-May-01 at 16:26

            Im using cyrildewit/eloquent-viewable package to get page views. When I check out the documentation, I don't see a method where I can only get views for a single date. It uses Period and Carbon to get dates in a particular period so the (since and upTo) functions.

            Any fix or alternative package to get page views.

            I am trying to create a analytics page.

            ...

            ANSWER

            Answered 2020-May-01 at 16:26

            You're not limited to since and upto, Period has (as per what I can see there https://github.com/cyrildewit/eloquent-viewable/blob/master/src/Support/Period.php) a create method that can take any date as start and end:

            Source https://stackoverflow.com/questions/61493894

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install eloquent-viewable

            First, you need to install the package via Composer:.

            Support

            In this documentation, you will find some helpful information about the use of this Laravel package.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/cyrildewit/eloquent-viewable.git

          • CLI

            gh repo clone cyrildewit/eloquent-viewable

          • sshUrl

            git@github.com:cyrildewit/eloquent-viewable.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link