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 show data by ID in laravel?
- How to get last month records in Laravel
- How to automatically update the timestamp of parent model in Laravel
- Import/Use Storage facade in laravel
- Rename Pivot Table in Laravel
- Skip first n record and display rest records in laravel view
- How to create and run user seeder in laravel
- How to call Laravel route in jQuery
- Laravel clone model
- How to add class to tr in table using foreach in laravel
- Best Practices for Error Handling in Production Server Code (example code)
- How to display 1 day ago in comments in laravel view
- Database transactions in laravel
- Argument 1 passed to Symfony\Component\HttpFoundation\Response::setContent() must be of the type string or null, object given
- How to get column names from table in Laravel
- Laravel get all records with pagination
- Laravel API response format
- OrderBy on Eloquent relationships method in Laravel
- SQLSTATE[42S22]: Column not found: 1054 Unknown column 'users.post_id' in 'where clause
- How to get date from created_at field in laravel
- Permanently delete a record in laravel
- How to display pivot table column value in laravel
- Target class [App\Http\Controllers\Auth\Request] does not exist.
- Permission denied error while creating storage link in Laravel
- How to check records exist in loaded relationship in Laravel blade view