Comments (14)
if I add the aliases 'Lava' => Khill\Lavacharts\Laravel\LavachartsFacade::class, it works
I'm using in laravel 5.1
from lavacharts.
You do not need to manually assign the alias, because it is automatically loaded for you 😄
But if you did want to override it, you would need to point it to the Facade
, not the ServiceProvider
'aliases' => [
'Lava' => Khill\Lavacharts\Laravel\LavachartsFacade::class,
from lavacharts.
I will be including this in the documentation, and depreciate the "auto" loading of the Facade
from lavacharts.
I am feeling like I should just remove the automatic alias bit, and add to the install docs about adding the alias. Most, if not all composer packages I have seen include in their docs about adding the alias. I don't even remember when I found the automatic alias loading bit of code.
Thoughts?
from lavacharts.
I have not tested in Laravel 5 yet, so I'm not sure why the Facade isn't working. The service provider should be registering the class alias. Try putting \Lava::methodName to see of that works?
from lavacharts.
Putting the backslash before Lava::methodName worked.
Thanks!!
from lavacharts.
No problem. I personally like knowing why things do or don't work, not just
how to fix them, so this is why that worked.
http://php.net/manual/en/language.namespaces.basics.php
Happy coding!
from lavacharts.
I have same problem using laravel 5.1 , using sample of demo
$votes = \Lava::DataTable();
$votes->addStringColumn('Food Poll') ->addNumberColumn('Votes') ->addRow(['Tacos', rand(1000,5000)]) ->addRow(['Salad', rand(1000,5000)]) ->addRow(['Pizza', rand(1000,5000)]) ->addRow(['Apples', rand(1000,5000)]) ->addRow(['Fish', rand(1000,5000)]);
and in view
<div id="poll_div"></div> @barchart('Food Poll', 'poll_div')
the output is
FatalThrowableError in DashboardController.php line 30: Fatal error: Class 'Lava' not found
Any help will be appreciate
from lavacharts.
What version of the package are you using?
from lavacharts.
The same problem here:
$popularity = \Lava::DataTable();
results:
Call to undefined method Khill\Lavacharts\Laravel\LavachartsServiceProvider::DataTable()
config\app.php:
'providers' => [
Khill\Lavacharts\Laravel\LavachartsServiceProvider::class,
'aliases' => [
'Lava' => Khill\Lavacharts\Laravel\LavachartsServiceProvider::class,
composer show
khill/lavacharts 3.0.6 PHP wrapper library for the Google Chart API
laravel/framework v5.3.30 The Laravel Framework.
from lavacharts.
Thank you Kevin it works now. But assigning the alias is not optional in Laravel 5.3.30 I had to enter it because it is not auto assigned. Tried multiple times with or without, also tried:
composer dump-autoload
artisan config:clear
artisan clear-compiled
VERSION:
$ php artisan --version
Laravel Framework version 5.3.30
from lavacharts.
Some more information if needed. Error was generated when upgrading from Laravel 5.3.29 to 5.4.11 and Lavacharts from 3.0.4 to 3.0.6.
This gets me an error:
app.php:
'providers' => [ "Khill\Lavacharts\Laravel\LavachartsServiceProvider",
Row 59 in Charts.php file:
$chart = \Lava::DataTable();
Error in laravel:
FatalThrowableError in Charts.php line 59: Class 'Lava' not found
But adding:
'aliases' => [ 'Lava' => Khill\Lavacharts\Laravel\LavachartsFacade::class,
to app.php resolves the problem.
Currently running:
`khill/lavacharts 3.0.6
laravel/framework v5.4.11
PHP 7.0.13`
from lavacharts.
I will try and recreate this environment and see whats up
from lavacharts.
'aliases' => [
'Lava' => Khill\Lavacharts\Laravel\LavachartsFacade::class,
its working fine
from lavacharts.
Related Issues (20)
- Cannot read property isHtml of null, Unspecified chart type HOT 9
- lavacharts.com is down HOT 15
- Chart to wkhtmltopdf not working HOT 4
- Piecharts have stopped working HOT 1
- Google Charts version "current" is breaking things HOT 4
- Use of <script type="text/javascript"> not right according to validator.w3.org HOT 1
- Trendlines with ColumnChart doesn't work. HOT 3
- How to use addTimeOfDayColumn method? HOT 2
- Khill\Lavacharts\Exceptions\InvalidStringValue: Invalid argument, must be a non-empty string
- while installing on ide-helper:generate an error occurs HOT 1
- Refused to load the script 'https://www.gstatic.com/charts/loader.js' because it violates the following Content Security Policy HOT 1
- Adding data descriptions on the X axis HOT 1
- OrgChart is included but not enabled. Why? HOT 1
- Cannot read property 'style' of null× HOT 3
- Dashboard / ChartWrapper missing functionality HOT 1
- Call to undefined method Khill\Lavacharts\DataTables\DataTable::DataTabe()
- OrgChart.php references trait "PngOutputTrait" instead of "PngRenderableTrait"
- Event is not defined
- Undefined type "Lava" error
- is this chart package still compatible with Laravel version 10? HOT 2
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 lavacharts.