Search code examples
phplaravelvoyager

How can I find the BaseDimmer Class?


I started a new voyager's project, but when I try to access to http://localhost:8000/admin suddenly appear this exception:

Class 'TCG\Voyager\Widgets\BaseDimmer' not found

I tried to find answers in github with some issue, but all I have find is change some parameters from config/voyager.php and still doesn't work.

Can someone tell me how I fix this to show the dashboard?


Solution

  • When you first install a project, and it has a composer.json in the root, then it means it uses Composer to manage its dependencies.

    Therefore all you need to do is run:

    composer install
    

    Composer will place all third party code in the vendor directory, and generate an autoload classmap.

    The project will probably already have a call to

    require_once '../vendor/autoload.php';` 
    

    In the public/index.php, but if it's a new one, then you can add that line, and now all classes will be available to use without requiring them in.

    If you don't have composer, you can get it here https://getcomposer.org/