Non-static method App\Http\Helper::myFunction() should not be called statically
Non-static method AppHttpHelper::myFunction() should not be called statically
Hello everyone, in this post we will look at how to solve "Non-static method AppHttpHelper::myFunction() should not be called statically" in programming.
Error Non-static method App\Http\Helper::myFunction() should not be called statically occurs when you try to call the non static function as static. To remove this error you change the type of function declaration or you can change the method of calling the function-
Change method from function myFunction() to public static function myFunction
//Use public static function myFunction(){ } //Instead of function myFunction(){ }
You have to change the function form function myFunction to public static function myFunction to avoid this error. Because you call this method statically (Helper::myFunction()) and you did not define function as a static function.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
Don't forget to share this article! Help us spread the word by clicking the share button below.
We appreciate your support and are committed to providing you valuable and informative content.
We are thankful for your never ending support.
Random Code Snippet Queries: Laravel
- How to validate website url in laravel using validaiton
- Class 'Facade\Ignition\IgnitionServiceProvider' not found
- Docker important commands to run laravel application with docker
- Property [user] does not exist on this collection instance
- Get laravel version
- How to remove P tag from CkEditor in Laravel?
- Setup laravel project with docker
- How to Run CRON Job on LIVE SERVER on Cpanel in Laravel Project
- Pass value from controller to model in laravel
- Send id with route Laravel
- How to authenticate admin users in Laravel ?
- How to create controller in laravel
- Retain selected value of select box in Laravel
- SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'posts_user_id_foreign'; check that column/key exists
- Call to undefined function Illuminate\Encryption\openssl_cipher_iv_length()
- Send OTP using textlocal api in laravel
- Ignore Records where a field has NULL value in Laravel
- Laravel 5.4 save data to database
- Ajax GET request in laravel
- How to change default timestamp fields name in Laravel
- Cannot end a section without first starting one
- Define variable and use in Laravel controller method
- Laravel 10 starter app using breeze on live server
- How to pass query string to url in laravel
- Laravel hasmany select not working