Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to undefined method #20

Open
caroteno opened this issue Nov 9, 2015 · 8 comments
Open

Call to undefined method #20

caroteno opened this issue Nov 9, 2015 · 8 comments

Comments

@caroteno
Copy link

caroteno commented Nov 9, 2015

After installing I get this error:
Call to undefined method J42\LaravelFirebase\LaravelFirebaseServiceProvider::publishes()

Whole error message:

{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Call to undefined method J42\\LaravelFirebase\\LaravelFirebaseServiceProvider::publishes()","file":"C:\\wamp\\www\\mealplan\\Development\\mea
lplan\\vendor\\j42\\laravel-firebase\\src\\j42\\LaravelFirebase\\LaravelFirebaseServiceProvider.php","line":42}}

My composer.json:

"require": {
        "laravel/framework": "4.2.*",
        "stripe/stripe-php": "^3.4",
        "barryvdh/laravel-ide-helper": "~1.11",
        "ktamas77/firebase-php": "dev-master",
        "j42/laravel-firebase": "dev-master"
    }

My app.php:

'J42\LaravelFirebase\LaravelFirebaseServiceProvider'

(...)

'Firebase'        => 'J42\LaravelFirebase\LaravelFirebaseFacade'

What am I doing wrong?
Regards.

@j42
Copy link
Owner

j42 commented Nov 9, 2015

Sounds like you put the service provider before the base laravel providers, which would explain why a method provided by inheritance -- from Illuminate\Support\ServiceProvider -- seems to be undefined.

Make sure you put the LaravelFirebaseServiceProvider in app.php after everything else.

[edit] Unless publishes is some kind of overloaded method provided by your IDE helper, as I don't see any reference to the method?

http://laravel.com/api/4.2/Illuminate/Support/ServiceProvider.html

@caroteno
Copy link
Author

caroteno commented Nov 9, 2015

Thank you for your reply.

They are at the end of everything else:

'providers' => array(

        'Illuminate\Foundation\Providers\ArtisanServiceProvider',
        'Illuminate\Auth\AuthServiceProvider',
        'Illuminate\Cache\CacheServiceProvider',
        'Illuminate\Session\CommandsServiceProvider',
        'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
        'Illuminate\Routing\ControllerServiceProvider',
        'Illuminate\Cookie\CookieServiceProvider',
        'Illuminate\Database\DatabaseServiceProvider',
        'Illuminate\Encryption\EncryptionServiceProvider',
        'Illuminate\Filesystem\FilesystemServiceProvider',
        'Illuminate\Hashing\HashServiceProvider',
        'Illuminate\Html\HtmlServiceProvider',
        'Illuminate\Log\LogServiceProvider',
        'Illuminate\Mail\MailServiceProvider',
        'Illuminate\Database\MigrationServiceProvider',
        'Illuminate\Pagination\PaginationServiceProvider',
        'Illuminate\Queue\QueueServiceProvider',
        'Illuminate\Redis\RedisServiceProvider',
        'Illuminate\Remote\RemoteServiceProvider',
        'Illuminate\Auth\Reminders\ReminderServiceProvider',
        'Illuminate\Database\SeedServiceProvider',
        'Illuminate\Session\SessionServiceProvider',
        'Illuminate\Translation\TranslationServiceProvider',
        'Illuminate\Validation\ValidationServiceProvider',
        'Illuminate\View\ViewServiceProvider',
        'Illuminate\Workbench\WorkbenchServiceProvider',

        'Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider',
        'J42\LaravelFirebase\LaravelFirebaseServiceProvider',
    )
'aliases' => array(

        'App'             => 'Illuminate\Support\Facades\App',
        'Artisan'         => 'Illuminate\Support\Facades\Artisan',
        'Auth'            => 'Illuminate\Support\Facades\Auth',
        'Blade'           => 'Illuminate\Support\Facades\Blade',
        'Cache'           => 'Illuminate\Support\Facades\Cache',
        'ClassLoader'     => 'Illuminate\Support\ClassLoader',
        'Config'          => 'Illuminate\Support\Facades\Config',
        'Controller'      => 'Illuminate\Routing\Controller',
        'Cookie'          => 'Illuminate\Support\Facades\Cookie',
        'Crypt'           => 'Illuminate\Support\Facades\Crypt',
        'DB'              => 'Illuminate\Support\Facades\DB',
        'Eloquent'        => 'Illuminate\Database\Eloquent\Model',
        'Event'           => 'Illuminate\Support\Facades\Event',
        'File'            => 'Illuminate\Support\Facades\File',
        'Form'            => 'Illuminate\Support\Facades\Form',
        'Hash'            => 'Illuminate\Support\Facades\Hash',
        'HTML'            => 'Illuminate\Support\Facades\HTML',
        'Input'           => 'Illuminate\Support\Facades\Input',
        'Lang'            => 'Illuminate\Support\Facades\Lang',
        'Log'             => 'Illuminate\Support\Facades\Log',
        'Mail'            => 'Illuminate\Support\Facades\Mail',
        'Paginator'       => 'Illuminate\Support\Facades\Paginator',
        'Password'        => 'Illuminate\Support\Facades\Password',
        'Queue'           => 'Illuminate\Support\Facades\Queue',
        'Redirect'        => 'Illuminate\Support\Facades\Redirect',
        'Redis'           => 'Illuminate\Support\Facades\Redis',
        'Request'         => 'Illuminate\Support\Facades\Request',
        'Response'        => 'Illuminate\Support\Facades\Response',
        'Route'           => 'Illuminate\Support\Facades\Route',
        'Schema'          => 'Illuminate\Support\Facades\Schema',
        'Seeder'          => 'Illuminate\Database\Seeder',
        'Session'         => 'Illuminate\Support\Facades\Session',
        'SoftDeletingTrait' => 'Illuminate\Database\Eloquent\SoftDeletingTrait',
        'SSH'             => 'Illuminate\Support\Facades\SSH',
        'Str'             => 'Illuminate\Support\Str',
        'URL'             => 'Illuminate\Support\Facades\URL',
        'Validator'       => 'Illuminate\Support\Facades\Validator',
        'View'            => 'Illuminate\Support\Facades\View',

        'Firebase'        => 'J42\LaravelFirebase\LaravelFirebaseFacade'

    ),

@caroteno
Copy link
Author

caroteno commented Nov 9, 2015

I did a clean Laravel install, and installed laravel-firebase.

Every time I do php artisan serve I get the same error:

{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Call to undefined method J42\\LaravelFirebase\\LaravelFirebaseServiceProvider::publishes()","file":"C:\\wamp\\www\\FIP\\fundacao\\vendor\\j42\\laravel-firebase\\src\\j42\\LaravelFirebase\\LaravelFirebaseServiceProvider.php","line":42}}

@j42
Copy link
Owner

j42 commented Nov 9, 2015

Ah sorry I see it now.  Has to do with the way package development is done as of Laravel 5: http://laravel.com/docs/5.1/packages

I made the new release explicit (0.4) and would suggest you use an older one if you don’t require newer Guzzle compatibility and don’t with to use Laravel 5.

On Nov 9, 2015, at 3:48 PM, caroteno [email protected] wrote:

I did a clean Laravel install, and installed laravel-firebase.

Every time I do php artisan serve I get the same error:

{"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"Call to undefined method J42\LaravelFirebase\LaravelFirebaseServiceProvider::publishes()","file":"C:\wamp\www\FIP\fundacao\vendor\j42\laravel-firebase\src\j42\LaravelFirebase\LaravelFirebaseServiceProvider.php","line":42}}


Reply to this email directly or view it on GitHub
.

@caroteno
Copy link
Author

caroteno commented Nov 9, 2015

Thank you, yes that was the issue. Using version 0.2.1 works fine with Laravel 4.2.17.

@javiervelaz
Copy link

I have the same error, which was you solution? what is "version 0.2.1" that you use to solved?

@caroteno
Copy link
Author

Hi @javiervelaz , I'm not able to confirm what I did at that time but I believe I simply stated (in the "require" module):

"j42/laravel-firebase": "0.2.1"

@caroteno caroteno reopened this Mar 18, 2016
@javiervelaz
Copy link

that worked, thanks.
but i have another issue now
Class 'J42/LaravelFirebase/LaravelFirebaseServiceProvider' not found

any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants