I created an helper and I try to use it in one of my controllers,but I got an error, and I am not sure why.
//StringHelper.php
namespace App\Helpers;
class StringHelper
{
public function example($str1){
//CODE
}
}
//config/app.php
'aliases' => [
'StringHelper' => App\Helpers\StringHelper::class,
]
//In controller
use StringHelper;
$percentage = StringHelper::example($title);
Non-static method App\Helpers\StringHelper::example() should not be called statically