I have a problem at Laravel. I have encrypted data and a function to decrypt it. When the URL Route is accessed through the browser, the page displays the correct contents. But when the URL is called by CURL, there is a "MAC is invalid" error return.
I have already run:
composer dump-autoload
composer clear-cache
php artisan cache:clear
But didn't help. Can anyone provide a solution?
Code:
use Crypt;
...
public function getProfile($request)
{
$profile = DB::table('user_profiles')->where('user_id',$request->user_id)->value('hash_data');
/* decrypt */
$profile_plain = Crypt::decrypt($profile);
$data = json_decode($profile_plain);
return response()->json([$data->personal]);
}
Using browser:
Thank you for your help.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire