Comments (12)
Thanks very much for the quick reply I will be sure to comment when it's fixed. Also, any plans on allowing to order model items by view count?
from eloquent-viewable.
I released v0.1.5. So a composer update
will install the new version.
Could you create another "issue" where you describe this missing feature. Because it has nothing to do with this "issue".
from eloquent-viewable.
Ran update, issue resolved! Thanks for the super fast response.
from eloquent-viewable.
Hi selfpaidinc,
First I want to thank you for reporting this issue.
I did a little research and found out why you are getting this error. I was type hinting a parameter of the function fromCamelCaseToDashes: (string $value)
. But I didn't knew that type hints cannot be used with types such as int or string.
Source: https://stackoverflow.com/questions/5724677/php-type-hinting-to-primitive-values
I will fix it and release a new version.
It would be great if you could post a comment when the new version fixed it for you, so I can close this issue.
from eloquent-viewable.
Sorry, must not have looked into this completely. Below my page content there is another exception.
(1/1) InvalidArgumentExceptionUnknown setter 'date'
in Carbon.php (line 758)
at Carbon->__set('date', '2017-07-14 16:57:26.000000')
at DateTime->__sleep()
at serialize(array('_token' => 'ftaE4vKPtBORLyXhFH5HGmGJS6qtifjuXRjgBcBI', '_previous' => array('url' => 'http://www.**********.com/*****/****************'), '_flash' => array('old' => array(), 'new' => array()), 'page-visits-counter' =>array('history' => array('track' => array(array('visitable_id' => 3, 'expires_at' => object(Carbon)))))))in Store.php (line 129)
at Store->save()in StartSession.php (line 88)
at StartSession->terminate(object(Request), object(Response))in Kernel.php (line 218)
at Kernel->terminateMiddleware(object(Request), object(Response))in Kernel.php (line 189)
at Kernel->terminate(object(Request), object(Response))in index.php (line 58)
from eloquent-viewable.
Could you tell me which Laravel version you are using? and on which version of PHP you are running the application. It might be possible that it is not compatible.
It seems that other people who are using HHVM, that they are getting this error too even when they are not using this package.
from eloquent-viewable.
I'm using Laravel 5.4 and HHVM
from eloquent-viewable.
Are you caching the model where you are calling the ->addVisitThatExpiresAt() function on?
from eloquent-viewable.
I'm still developing so not caching anything yet.
from eloquent-viewable.
I don't think this has anything to do with Laravel Page Visits Counter. Can you maybe post a screenshot of the full error on the webpage and (if it's there) the error inside the laravel.log
file that you can find inside the storage directory.
from eloquent-viewable.
When I comment out $track->addVisitThatExpiresAt(Carbon::now()->addHours(3)); the error goes away.
[2017-07-14 16:09:28] local.ERROR: exception 'InvalidArgumentException' with message 'Unknown setter 'date'' in /var/www/clients/client1/web1/web/laravel/vendor/nesbot/carbon/src/Carbon/Carbon.php:758
Stack trace:
#0 (): Carbon\Carbon->__set()
#1 (): DateTime->__sleep()
#2 /var/www/clients/client1/web1/web/laravel/vendor/laravel/framework/src/Illuminate/Session/Store.php(129): serialize()
#3 /var/www/clients/client1/web1/web/laravel/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(88): Illuminate\Session\Store->save()
#4 /var/www/clients/client1/web1/web/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(218): Illuminate\Session\Middleware\StartSession->terminate()
#5 /var/www/clients/client1/web1/web/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(189): Illuminate\Foundation\Http\Kernel->terminateMiddleware()
#6 /var/www/clients/client1/web1/web/laravel/public/index.php(58): Illuminate\Foundation\Http\Kernel->terminate()
#7 {main}
from eloquent-viewable.
I'm sorry but I can't fix this. It has something to do with HHVM. I think when you upload your application to a real web server (like a droplet of DigitalOcean) it will work.
It seems that HHVM compiles php code differently than Apache or nginx.
Try it again by running the application with php artisan serve
. This will use the original php.
from eloquent-viewable.
Related Issues (20)
- give point to post author on unique post view HOT 1
- how can I get user post view count HOT 1
- how to get total number of views of all posts HOT 1
- Getting Column not found when using ->orderByViews() HOT 10
- Laravel 9 support HOT 6
- `touch` the parent timestamp if the view has been recorded HOT 3
- Error : Cannot record a view for a viewable type HOT 1
- How to add some fields to table views HOT 1
- cannot record new views instance HOT 2
- Is there a way to record a view on cyrildewit / eloquent-viewable with the user_id not just the viewable_id HOT 1
- local.ERROR: Undefined index: lifetime_in_minutes
- Class "Period" not found HOT 2
- How can I check if an auth user or a visitor has already viewed a post? HOT 4
- Laravel 10 Support HOT 2
- PHP 8.2 support HOT 2
- CyrildeWit\EloquentViewable\Views::forViewable(): Argument #1 ($viewable) must be of type HOT 1
- How to extend the package to also count other things HOT 2
- User show the post twice HOT 1
- [Question] Seperate records by type
- Sort OutType Error:
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eloquent-viewable.