Comments (6)
@sergchernata - That appears to be working how Laravel Facades are meant to, yes - a Facade gives you a static interface to a common instance of an object, so you don't have to recreate it in, or pass it around to, every method you want to use it in.
If you want to use a regular object instead of a Facade, add use Nathanmac\Utilities\Parser\Parser;
at the beginning of each file you want to use it in (instead of use Parser;
, which will grab the Facade instead).
I agree the README is more than a little vague on this front. I'll see if I can clean it up some.
@fscaptain - I expect, since it's been about a year, that you aren't having this issue any more, likely because you're using something else to handle parsing, but if your troubles came from the same place, your solution should be the same, too. Either use the regular object directly along with new
, or treat the Facade as a static interface to a singleton. Again, I'll see if I can submit a PR to update the README on this bit.
from parser.
Hi @fscaptain, have you added the service provider and/or alias in the app/config/app.php
file?
from parser.
Really, as described in the readme. Should it be that this may be wrong, because all others entries there are slighly different ?
from parser.
Did you try to escape the Classname like in
$xml = Parser::xml(($response->getBody()->getContents()));
?
I am running Parser on Laravel 5.1.26 without problems
Andreas
from parser.
Hi, in this way it works also for me, but if i try to use the alias it comes ot the error.
from parser.
Having the same issue on Laravel 5.3
Calling this:
$parser = new Parser();
$parser->xml($xml);
results in:
Call to undefined method Nathanmac\Utilities\Parser\Facades\Parser::xml()
However, this works:
Parser::xml($xml);
from parser.
Related Issues (20)
- XML Parsing and attributes HOT 2
- XML parsing exception HOT 3
- Read remote XML HOT 2
- [Question] Get attributes in tags HOT 4
- Failed to parse XML HOT 9
- ParserException in XML.php line 33: Failed To Parse XML HOT 1
- Weird behaviour HOT 2
- How do I filter the result of the parser? HOT 3
- Parsing XML Example HOT 5
- composer.lock
- is this bug? HOT 2
- How to use GET function? HOT 1
- Is there any problem with multidimensional xml to array conversion? HOT 2
- ParserException in JSON.php line 30: Failed To Parse JSON HOT 3
- how to serialize to xml from array
- How can i edit ParserException HOT 1
- laravel/framework v5.4.36 HOT 1
- dependency on symfony/yaml 4.* HOT 4
- Laravel 7 support HOT 6
- laravel 8
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 parser.