
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 add foreign key in laravel using migration
- How to get IP address in laravel
- Drop foreign key column in Laravel using migration
- Return view from route Laravel
- How to check record exist or not in relationship table
- Trying to access array offset on value of type null error in laravel
- Root composer.json requires php ^7.3 but your php version (8.0.0) does not satisfy that requirement
- Get the post details if it has at least one comment in comments table
- Laravel recursive function in controller
- How to show data by ID in laravel?
- Delete records with relationship in laravel
- SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel8.projects' doesn't exist
- Laravel insert query not working
- Return redirect laravel not working
- How to check query string exists or not in laravel blade
- Get ids in array from users table
- Call to a member function getRelationExistenceQuery() on array in Laravel
- How to pass query string with pagination in laravel
- Class 'Facade\Ignition\IgnitionServiceProvider' not found
- Laravel save object to database
- Redirect from www to non www in laravel using htaccess
- Wheredate in laravel not working
- Laravel pagination links with query string
- Display success message in laravel
- Laravel onclick function not working