dimanche 3 mars 2019

After add encryption function "The payload is invalid" error shows up

I use this gentleman's todo app by mysql. it works perfect.

https://github.com/ericlie/Laravel-Simple-Todo-List#setting-up

I tried add Encryption and Decryption into this app using this gentleman's answer.

Encryption and decryption in Laravel 5

I have problem. After I add below code. "The payload is invalid" error show up. I've been searching and tryied Ecryption and Decryption function but it always error comes up. Last time I add some code to solve "The payload is invalid" but it didn't work.

Could you teach me what is wrong my code Please? I would like to Encryption and Decryption Task table's "task" columme and "users" table's "name" and "email".

Here is Controller of task

class Task extends Model
{
    // I add this 
    use EncryptsAttributes;
    protected $encrypts = ['task'];



   // original code
    public function user()
    {
        return $this->belongsTo(User::class, 'user_id');
    }
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire