42coders / eu-cookie-consent

MIT License
60 stars 17 forks source link

Error: Non-static method the42coders\EuCookieConsent\Http\Controllers\EuCookieConsentController::saveCookie() should not be called statically #10

Open rargueso opened 3 years ago

rargueso commented 3 years ago

php 7.4 Laravel 5.5

Raise error: Non-static method the42coders\EuCookieConsent\Http\Controllers\EuCookieConsentController::saveCookie() should not be called statically

Static calls are not allowed on prior versions.

How to fix?

routes.php

Route::post(config('eu-cookie-consent.route'), ['uses' => '\the42coders\EuCookieConsent\Http\Controllers\EuCookieConsentController@saveCookie']);

instead

Route::post(config('eu-cookie-consent.route'), [\the42coders\EuCookieConsent\Http\Controllers\EuCookieConsentController::class, 'saveCookie']);