Giter VIP home page Giter VIP logo

Comments (6)

danhunsaker avatar danhunsaker commented on August 24, 2024 1

@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.

nathanmac avatar nathanmac commented on August 24, 2024

Hi @fscaptain, have you added the service provider and/or alias in the app/config/app.php file?

from parser.

fscaptain avatar fscaptain commented on August 24, 2024

Really, as described in the readme. Should it be that this may be wrong, because all others entries there are slighly different ?

from parser.

andreasba avatar andreasba commented on August 24, 2024

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.

fscaptain avatar fscaptain commented on August 24, 2024

Hi, in this way it works also for me, but if i try to use the alias it comes ot the error.

from parser.

sergchernata avatar sergchernata commented on August 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.