Giter VIP home page Giter VIP logo

Comments (9)

driesvints avatar driesvints commented on August 28, 2024

Hmm that should work just fine. Did you try clearing your views?

from blade-icons.

fredericseiler avatar fredericseiler commented on August 28, 2024

Views cleared, no changes.

from blade-icons.

driesvints avatar driesvints commented on August 28, 2024

It's weird because I'm using atm as such and it works for me. So I'm wondering what's different for you. You're sure you're using the latest commit from the next version branch?

from blade-icons.

fredericseiler avatar fredericseiler commented on August 28, 2024

I installed it 30 minutes ago, but to be sure:

composer.json

{
    ...
    "require": {
        ...
        "nothingworks/blade-svg": "dev-next-version"
    },
    ...
}
$ composer update
Updating dependencies (including require-dev)         
Nothing to install or update
...
Discovered Package: nothingworks/blade-svg

$ php artisan view:clear
Compiled views cleared!

I still got a ViewException.

from blade-icons.

fredericseiler avatar fredericseiler commented on August 28, 2024

Has it something to do with the fact that the Factory is defined as a singleton in the Service Provider but is actually never called (so the registerComponents() method can't do its magic) ?

from blade-icons.

fredericseiler avatar fredericseiler commented on August 28, 2024

I added this inside the registerFactory() of BladeInconsServiceProvider to instantiate the singleton, and it works now:

private function registerFactory(): void
{
    /* ... */

    $this->app->make(Factory::class);
}

from blade-icons.

fredericseiler avatar fredericseiler commented on August 28, 2024

Or just bind the instance:

private function registerFactory(): void
{
    $config = $this->app->make('config')->get('blade-icons');

    $factory = new Factory(new Filesystem(), $config['class']);

    foreach ($config['sets'] as $set => $options) {
        $options['path'] = $this->app->basePath($options['path']);

        $factory->add($set, $options);
    }

    $this->app->instance(Factory::class, $factory);
}

from blade-icons.

driesvints avatar driesvints commented on August 28, 2024

@fredericseiler thanks, that's a good tip. Just pushed a commit which should fix this. Not sure why I didn't caught this before.

from blade-icons.

fredericseiler avatar fredericseiler commented on August 28, 2024

Fixed indeed, thank you!

from blade-icons.

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.