fxcosta / laravel-chartjs

Simple package to facilitate and automate the use of charts in Laravel 5.x using Chartjs v2 library
485 stars 113 forks source link

parse error, expecting `';'' or `'{'' when writing laravel-chartjs #32

Closed Rana-xD closed 7 years ago

Rana-xD commented 7 years ago

I don't know what is the main issue. I have already install laravel-chartjs extension to my laravel . And I attempted to copy the sample code in README to run in my laravel application. This is my code:

screenshot

When I ran that code, it didn't work. It shows the below error.

screenshot 2

I would like to know the exact issue and any possible solutions. Thanks.

fxcosta commented 7 years ago

@Rana-xD plz, update the package. appear the your package version is outdated. this bug was fixed and merged to master already

Rana-xD commented 7 years ago

@fxcosta, what is its latest version. I've tried to run composer update, yet it still didn't work.

pjeutr commented 7 years ago

For some reason, composer is still returning the older version with : self at Builder.php:118 https://packagist.org/packages/fx3costa/laravelchartjs shows the latest version

pjeutr commented 7 years ago

changing composer.json manually to 2.2.1 fixes it for me "fx3costa/laravelchartjs": "^2.2.1",

after that ofcourse run composer update

fxcosta commented 7 years ago

I need to study more about package versioning but I believe that with the current situation of the library and with constant additions and bug fixes the best would be to keep something like:

"fx3costa/laravelchartjs": "~2.2",
Rana-xD commented 7 years ago

Thanks, it works now. I need to run composer update fx3costa/laravelchartjs to solve this problem. And also thanks to @pjeutr for your solution.