mardi 8 décembre 2020

How to use traits inside a helper function

I'm trying to use a trait inside an helper function but its throwing error like this

Using $this when not in object context

this is my helper function

namespace App\Helpers;

use Log;
use Exception;
use Twilio\Rest\Client;
use App\Traits\HelperTrait;
class Twilio {

    use HelperTrait;

    static function cdata($hApp){
        return response()->json($this->notPdResponse($hApp));
    }
}


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire