devma
devma

Reputation: 43

PHP Fatal error: Call to undefined method Illuminate\Foundation\Application::bindShared() in ..Entrust/EntrustServiceProvider.php on line 72

I've just installed Entrust to add Role-based Permissions to my application based on Laravel 5.2. But when I try to execute

php artisan vendor:publish

I get this error :

PHP Fatal error: " Call to undefined method Illuminate\Foundation\Application::bindShared() in ../vendor/zizaco/entrust/src/Entrust/EntrustServiceProvider.php on line 72 "

can anyone help me?

Upvotes: 4

Views: 5410

Answers (3)

Rajeev Ranjan
Rajeev Ranjan

Reputation: 1

I have researched more and got solution you need update function name only.

vendor/illuminate/html/HtmlServiceProvider.php

$this->app->bindShared('form', function($app) 

To

$this->app->singleton('form', function($app)

on line number : 36 and 40

Upvotes: 0

Raihan Mahmud
Raihan Mahmud

Reputation: 78

just repalce bindShared() with singleton()

Upvotes: 5

Marcin Nabiałek
Marcin Nabiałek

Reputation: 111829

You are using previous version that is not compatible with Laravel 5.1.+. Make sure you are using latest version or run composer update zizaco/entrust to update this package to latest version that is defined in composer.json

If you look at this commit you will set it has been already changed a while ago.

Upvotes: 1

Related Questions