Answer the question
In order to leave comments, you need to log in
How to fix encoding in json Laravel?
I decided to try to work with api in Laravel I
deployed it in Laragona, I created a database with utf8mb4_unicode_ci encoding I
created two rest controllers for products and categories, set up a simple admin panel and fill the database in the usual way
Then I made a controller for output through the API
in it a method
public function index()
{
$products = $this->productRepositiry->getAllProducts();
$data = json_decode($products, JSON_THROW_ON_ERROR);
//dd( $data);
return $data;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question