lundi 29 novembre 2021

Calling the failed function: 'should not be called statically' in laravel 5.4

I use version laravel 5.4

In Helpers/Helper.php

public function test()
{
  return 'success';
}

In controller

use App\Helpers\Helper;

public function index()
{
  $val = Helper::test();
  dd($val);
}

Error : Helper::test() should not be called statically

I called the function inside helper to use it. But got the error as above. Please show me how to get the function in helper. Thank you



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3d3iyLG
via IFTTT

Aucun commentaire:

Enregistrer un commentaire