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 display serial number in Laravel?
- Page loader in laravel
- Get 30 days older records from table in laravel
- How to get route name on visit URL in laravel
- How to decrypt laravel password
- Laravel create default admin user
- How to Get records between two dates in Laravel
- How to add script on specific view file in laravel while extending layout
- How to get id of next record in laravel
- RuntimeException You must enable the openssl extension in your php.ini to load information from https://repo.packagist.org
- Display first n record from collection in laravel view
- Delete all related comments on deleting a post in Laravel
- If condition in foreach loop in laravel
- How to upload local Laravel project to server ?
- How to display a specific word from a string in laravel
- How to customize pagination view in laravel
- Get posts belongs to a specific user in Laravel
- Argument 1 passed to Illuminate\Database\Query\Builder::cleanBindings() must be of the type array, null given
- How to run a specific seeder class in laravel
- How to upload image in laravel 8
- Extra Filter Query on Relationships in Laravel
- Ignore Records where a field has NULL value in Laravel
- Pass variable from blade to controller Laravel
- Create record with unique slug in laravel
- Target class [HomeController] does not exist