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

Laravel 5.4 : Call to undefined method Illuminate\Session\Store::getToken() #320

Open
Mopster opened this issue Mar 6, 2017 · 11 comments
Open

Comments

@Mopster
Copy link

Mopster commented Mar 6, 2017

Hi,

I encountered the following exception with Laravel 5.4

FatalErrorException in BootstrapperL5ServiceProvider.php line 210:
Call to undefined method Illuminate\Session\Store::getToken()

According to the upgrade docs, this should become ->token()

All calls to the ->getToken() method should be changed to ->token().
@mianshargeel
Copy link

Yes it works thanks

@amjtnr
Copy link

amjtnr commented Jun 14, 2017

It's working.

@tortuetorche
Copy link
Contributor

I think this issue can be closed.

Have a good day,
Tortue Torche

@pbrink231
Copy link

Downloaded this morning and have this issue.

I have the error.
Call to undefined method Illuminate\Session\Store::getToken() (View: C:\websites\prodright\companies\laforma-prodright\resources\views\auth\login.blade.php)

I am still new the laravel but i dont see getToken() in the view at all.

@PatrickRose
Copy link
Collaborator

@pbrink231 - could you dump your composer.json here?

@walterdis
Copy link

Add to your app\Providers\AppServiceProvider.php in the register()

$this->app->bind('bootstrapper::form', function ($app) { $form = new Form( $app->make('collective::html'), $app->make('url'), $app->make('view'), #$app['session.store']->getToken() $app['session.store']->token() ); return $form->setSessionStore($app['session.store']); },true);

@VladJamir
Copy link

edit the vendor\laravelcollective\html\src\HtmlServiceProvider.php@registerFormBuilder change getToken() to just token()

@pbrink231
Copy link

pbrink231 commented Aug 8, 2017

@PatrickRose Sorry for the long delay.

I deleted my vendor folder. then ran composer install and still had the problem.

I tried @VladJamir solution but under vendor\laravelcollective\html\src i only have the folder Eloquent.

below is a dump of my composer.json

{
    "name": "florientr/laravel-gentelella",
    "description": "The Laravel 5.4 framework with Gentelella template",
    "keywords": [
      "framework",
      "laravel",
      "laravel 5.4",
      "gentelella",
      "laravel-gentelella",
      "template",
      "bootstrap",
      "responsive",
      "admin",
      "php",
      "html",
      "css",
      "taggable",
      "gravatar",
      "form html"
    ],
    "license": "MIT",
    "version": "4.3.0",
    "type": "project",
    "require": {
        "php": ">=7.0",
        "laravel/framework": "5.4.*",
        "thomaswelton/laravel-gravatar": "~1.0",
        "rtconner/laravel-tagging": "~2.2",
        "laravelcollective/html": "5.4.0",
	  	"watson/bootstrap-form": "1.1.*",
        "yajra/laravel-datatables-oracle": "7.5"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~5.7",
        "symfony/css-selector": "3.1.*",
        "symfony/dom-crawler": "3.1.*"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
      "psr-4": {
        "Tests\\": "tests/"
      }
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postInstall",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "php artisan optimize"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

@prateektakoria
Copy link

thank u

@abhimanusharma
Copy link

SOLUTION
No need to touch the vendor folder.
Open composer.json file, replace "laravelcollective/html": "5.4.0" with "laravelcollective/html": "^5.4.0"

Run Command: composer update

Enjoy!

@mirfan17
Copy link

SOLUTION
No need to touch the vendor folder.
Open composer.json file, replace "laravelcollective/html": "5.4.0" with "laravelcollective/html": "^5.4.0"

Run Command: composer update

Enjoy!

Thank you brother you saved my day.

tortuetorche added a commit to tortuetorche/bootstrapper that referenced this issue Dec 1, 2020
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