Atbox / invi-l5

A simple invitation system api for laravel 5

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error Class 'Atbox\Invi\InviServiceProvider' not found

SrPatinhas opened this issue · comments

When i try to run some code on the terminal, it returns this error

  [Symfony\Component\Debug\Exception\FatalErrorException]
  Class 'Atbox\Invi\InviServiceProvider' not found

but when im trying to run composer dump-autoload it returns one warning

Warning: Ambiguous class resolution, "Invitations" was found in both "$baseDir . '/database/migrations/2014_02_28_192137_invitations.php" and "G:\wamp\www\projects\laravel5\vendor\atbox\invi\src\migrations\2014_02_28_192137_invitations.php", the first will be used.

Any suggestion or help? :)

Please update composer again, I changed class name of migration file.

@sajjadrad I recieved the same error,[Symfony\Component\Debug\Exception\FatalErrorException] Class 'Atbox\Invi\InviServiceProvider' not found,the bug have been fixed?

@cynhard Run composer dump-autoload
If still exists, check all installation steps again.

Hi, I am experiencing this same issue. Composer dump-autoload didn't do the trick. It's very strange because I had installed Invi and it was working fine, but when I installed another package via composer, Invi breaks:

[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Atbox\Invi\InviServiceProvider' not found

I think it may have something to do with this message that happens during php artisan optimize:

Generating optimized autoload files
Warning: Ambiguous class resolution, "CreateInvitationsTable" was found in both "$baseDir . '/database/migrations/2016_05_15_192137_create_invitations_table.php" and "/Applications/MAMP/htdocs/invite/vendor/atbox/invi/src/migrations/2014_02_28_192137_create_invitations_table.php", the first will be used.

Hi, thanks for using Invi.

Can you install Invi again? please remove it from composer and config/app.php and update composer, then add it again and update composer. It's possible there is some conflict with your new package.
let me know about it.

Thanks

I've removed it from both places, updated, and re-added it as you suggested, but I still get an error when running composer-update. It occurs at the end, when php-artisan optimize is called. I am running the latest laravel and there is hardly anything else going on in my package. I'm on OSX.

php artisan optimize

[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Atbox\Invi\InviServiceProvider' not found

Script php artisan optimize handling the post-install-cmd event returned with an error

[RuntimeException]
Error Output:

Ok, I will check it again

I'm getting the same error as @huntercarter ...been messing around with it for a few days now. From what I can tell, this issue prevents you from running ANY 'php artisan' command. A temporary workaround is to type 'composer dump-autoload -o' (the -o is important, without it, it will not fix the problem).

After running 'composer dump-autoload -o', this will allow you to run ONE SINGLE 'php artisan' command. The second time you try to run a 'php artisan ' command, you will get the error again until you run 'composer dump-autoload -o' again.

This is the exact error that I get:

PHP Fatal error:  Class 'Atbox\Invi\InviServiceProvider' not found in /var/www/html/projectNameHere/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 146


  [Symfony\Component\Debug\Exception\FatalErrorException]
  Class 'Atbox\Invi\InviServiceProvider' not found
commented

it's take me a long time...

just edit this 2 files:
bootstrap/cache/services.php
bootstrap/cache/config.php

delete the line include "InviServiceProvider", 4 lines.

then composer update

I fixed by changing the atbox/invi's composer.json: psr-0 to psr-4
Then run composer update again