
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 insert value to additional columns in pivot table in laravel
- SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'user_id'
- Route group with URI prefix using middleware and route name prefixes
- How to check query string exists or not in laravel blade
- Link storage folder in laravel 8
- SQLSTATE[23000]: Integrity constraint violation: 1022 Can't write; duplicate key in table
- Laravel specific table Migration
- Rendering HTML from database table to view in Laravel
- Count all and get 10 records after where condition in laravel
- Shorter syntax for whereHas with call back function in laravel
- How to validate URL with https using regex in laravel
- How to call Laravel route in jQuery
- How to get tomorrow and yesterday date in laravel
- How to get count of all records created at yesterday
- Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails
- How to check record exist or not in relationship table
- How to get images from AWS s3 and display in Laravel blade
- Call to a member function update() on null
- How to get all route list
- How to make Copy or Duplicate table row in laravel
- SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'posts_user_id_foreign'; check that column/key exists
- Retain selected value of select box in Laravel
- Seed database using SQL file in Laravel
- Cannot end a section without first starting one
- How to check find method executed successfully in laravel